Get data from main form?

G

G Lam

Hi, I had a data entry form with subform.
The main form had 4 fields:
OrdId, BinId, PID and Date
The subForm had 4 fields:
OrdSubID, BinSubId, InvID and NbrOfItem.
The linking field was OrdId. When user entered data, the OrdId data would go
into the subform's ORdSubID field. I also when the BinSubID in the subform
got the data from the BinId in the main form too. I wrote a line of code
like this:
In the Enevt tab of InvID field (SubForm) property :
Private Sub InvID_GotFocus()
BinSubId = [PMain].BinId
End Sub
I was thinking that when the InvId field got focus, A2K got the data from
PMain form's BinId field and inserted that data to the BinSubId in the
subform.
But it did not work. Please help.

Thank you
Gary
 
J

John Vinson

I also when the BinSubID in the subform
got the data from the BinId in the main form too.

Make BOTH fields part of the Master and Child Link Fields:

Master - OrdID;BinID
Child - OrdID;BinSubID
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top