Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate a field in a New Form from Previous Form

Status
Not open for further replies.

tfayer

Technical User
Aug 4, 2002
41
US
I have a form called frmContacts that uses contact_ID set to AutoNumber as the Primary Index. This form has a subform called sfrmContactNotes in Datasheet View that I have set to NoEdits, Deletions or Additions. I put a CmdButton, Enter New Note, at the bottom that opens a form where you can type your new note.

How do I get the contact_ID from the frmContacts form to be entered in the field on the tblContactNotes. If I did it directly in the subform it does automatically due to Lnk Master/Child Fields.

I have tried setting the default value to accomplish this. I have also tried Me![contact_ID] = Forms!frmContacts!contact_ID

Nothing Works. Please help.
 
Declare a Global variable - lngContactId
1. If you want to add new Contact Just Insert the record when you click Done or Ok button on sfrmContactNotes Form
and try below code to refresh List form
dim frmList as Form
Set frmList = Form![frmContacts]![SubForm].Form 'sfrmContactNotes - SubForm:Subform control Name
frmList.refresh

2. If trying to update, In when you click Note button assign Id to lngContactId and get the values in sfrmContactNotes open event.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top