Eljefegeneo
Still trying to learn
- Local time
- Today, 11:33
- Joined
- Jan 10, 2011
- Messages
- 902
I have two tables, Table1 and Table2 and two related forms, Frm1 and Frm2. I want to be able to update the data on Table1 from Frm2, that is, if I change the data on Frm2, the corresponding fields in Table1 will update to the same data. I know that if both tables are open I can reference the fields on Frm1 and Frm2 with an IF statement: If Active = True And Forms!Frm1a.DoNotchange = False Then
And I know on the update query I can reference a control on a form by Forms!Formname.Control. Wll works fine.
What I would like to know is can I reference a table field in the same way. For example, I have tried to use the IF Statement If Active = True And Tables!Table1.DoNotchange = False Then
But I get an error. Is there a way to reference the Table instead of the Form in both the VBA and the query?
The problem seems to be that I have the two bound controls [Active] on Frm2 and [DoNotChange] on Frm1. (Which I need).
I've attached a simple DB to show what I mean.
And I know on the update query I can reference a control on a form by Forms!Formname.Control. Wll works fine.
What I would like to know is can I reference a table field in the same way. For example, I have tried to use the IF Statement If Active = True And Tables!Table1.DoNotchange = False Then
But I get an error. Is there a way to reference the Table instead of the Form in both the VBA and the query?
The problem seems to be that I have the two bound controls [Active] on Frm2 and [DoNotChange] on Frm1. (Which I need).
I've attached a simple DB to show what I mean.