Can I update calculated field in the continuous form (1 Viewer)

masoud_sedighy

Registered User.
Local time
Today, 11:41
Joined
Dec 10, 2011
Messages
132
I have two tables. In table1 I have 2 columns like below, Doc No is (pk)

Doc No Title
-------- -----------
Doc-0001 test-0001
Doc-0002 test-0002

In table 2 I also have two columns Doc No (pk), Transmittal (pk)

Doc No Transmittal
--------------------------
Doc-0001 TT-0001
Doc-0001 TT-0002
Doc-0002 TT-1000

Now I want to create a continuous form that has 3 fields based on table 1 like below

Doc No title checkbox

if I have related record for each Doc No in table2 it shows in the continuous form with ticked check box, in the form and when un ticked check box it deleted related records table2.

I have thought about that with steps like below but I have some doubt:

1-I have to write a query based on table1 and it has a calculated column that returns (0) or (-1) if find related record in table 2.
Doc No title checkbox

2-I have to write a before update event for check box of the form for deleting related records in table 2 when untick the checkbox.

My question is about the calculated field in the form. Can I update that?

I mean can I untick that in the form? Or just it is a read only field and I cannot tick or untick that and so event procedure does not work on that?

how can handle this problem? is possible updating calculated field? for handling this scenario need changing design of tables or what is the best solution for solving this problem

What is the solution please?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 02:41
Joined
May 7, 2009
Messages
19,229
Either you add a Yes/No field on table1 or change recordsource of form to ado.
 

masoud_sedighy

Registered User.
Local time
Today, 11:41
Joined
Dec 10, 2011
Messages
132
thanks, cross post, because i did not find the solution yet. i am looking for a solution to solve my problem. i waited when i found i did not find a solution i put another post.
 

masoud_sedighy

Registered User.
Local time
Today, 11:41
Joined
Dec 10, 2011
Messages
132
about change recordsource of form to ado is it possible more explanation or related sample
 

Minty

AWF VIP
Local time
Today, 19:41
Joined
Jul 26, 2013
Messages
10,368
Why not just run a delete query based on the on click event of the checkbox, then requery the underlying data? Or add a cmd Button next to the check box to do the delete?
 

masoud_sedighy

Registered User.
Local time
Today, 11:41
Joined
Dec 10, 2011
Messages
132
thanks, i will use your solution, and if also i wanted to insert a record on table2, i have to add another another cmd button and then use append query , for Adding record to table2. i mean for each record in continuous form there are Delete and Added buttons. and with requery of underlying table value of check box will be updated. i have another question, is not possible managing with just click event of checkbox deleting and inserting records without using buttons for Deleting and inserting records.
 

Minty

AWF VIP
Local time
Today, 19:41
Joined
Jul 26, 2013
Messages
10,368
You could try, based on the value of the check box, run a delete or insert then requery? Not something I have ever tried.
 

Users who are viewing this thread

Top Bottom