Link a field on form to subform

manovice

Registered User.
Local time
Today, 10:57
Joined
Nov 21, 2008
Messages
11
Hello there. I have been able to work many of my kinks out through web surfing, but was hoping you could possibly help me out here.

I have a main form that has a field for a report number. Not all reports require a letter, but when they do, I have a subform that will come up that contains that report number field.
Question is... how do I get the field on the subform to automatically populate with the report number. I have already entered the report number on the main form when the subform opens.

Then leading to the next question... I have a command on the main form that saves the record when no letter is needed and the subform does not open, but when a letter is issued and I open the subform, I would like to insert a command button that will add the record from the main form and the subform and then close the subform and refresh the main form.
Any ideas/suggestions.

Thank you so very much for your assistance with this.

Also, both of these forms are pulling from a query that contains all of the information for both forms.
 
Since the main form and sub form some how related to each other, would it be easier to just write a query to update the Report number on the main form's data source
if there's a report number found on the sub form's data source
.

Let's say main form's data is from tbl1 and subform's data is from tbl2

Can you just do something like this?

if tbl1 = tbl2 and tbl2 has Report Number then update tbl1's report number field to tbl2's report number.

Assumming that tbl1 and tbl2 has a primary/forien key relationship.
 

Users who are viewing this thread

Back
Top Bottom