Using data in a subform on a main form

garyholc

Registered User.
Local time
Today, 18:32
Joined
Jul 15, 2008
Messages
64
Here is my problem. I have a "main form" on which I have some fields. For one of the fields, I want to say that if the date field is blank, it is to use the date field (for the same building) from another table.

Ive built a query which shows the date from the other table, depending on the building number which is displayed on the main form.

Ive placed the subform on the main form so I can see the date, but how do I go about transferring the date from this form/query into the field on the main form, so it not only shows in the field but also adds it to the main table.

Or can someone else think of a better way of doing this?
 
this is not real clear to me, but in general, the main should be bound to a table, and so should the sub. any value that is put in a field on the main SHOULD show up in the table automatically, as all the main's fields should be bound (usually is the case).


however you go about populating the datefield in the main, if you need it, if the field in the main is bound, it shows up in the table, always. no reason why it shouldn't. the code to populate a main field with a sub's field value should be something like (assuming the focus is on the main):
Code:
me.fieldname = me.subContainer.form!Fieldname
 

Users who are viewing this thread

Back
Top Bottom