Connecting forms?

Bentleybelle

Registered User.
Local time
Today, 08:17
Joined
Feb 22, 2004
Messages
53
I think my problem is similar to that posted by southernbell, so here it is (again?)
I have a series of forms which are accessed via command buttons on a customer data entry form. I want to be able to carry forward a file reference from the (primary) customer data entry to the linked form. I have done this by entering =[forms]!frm[formname]![fieldname] in the control source, but of course this does not enter it into the underlying table; as this field happens to hold the relationship, any data entered into the (secondary) form goes into the table but does not show in the form.
Any help would be appreciated, as a new user, I find this forum the best for Access! so thanks in anticipation.
 
It's ok to use that as the control source for an unbound field (but change the control name on the Other tab to avoid confusion). To populate the bound field, put the following in the BeforeInsert event of the form:

Me.fieldname = [forms]!frm[formname]![fieldname]

The reason I choose the BeforeInsert event for this code is because I don't want to dirty the form with my code. The BeforeUpdate event runs as soon as a single character is typed into the form. That means that the user has dirtied the form himself, so it's ok for me to also. When you put this code in other events, it can cause strange interface issues for the user because he KNOWS that he never typed anything into the form and yet he gets error messages if he attempts to close it without completing a record.
 

Users who are viewing this thread

Back
Top Bottom