OpenArgs

  • Thread starter Thread starter Oli
  • Start date Start date
O

Oli

Hi

Hope someone can help!

I have a form (ftm_Contacts) and when a command button is clicked another
form (frm_termchange) is opened, like this:

DoCmd.OpenForm "frm_termchange", , , , , , OpenArgs:=ContactID

From here in the new form I have a Combo Box which is displaying items in it
which relate to the ContactID.

However, i also want a textbox to display the Company Name of the record
currently open on frm_Contacts when the command button was clicked.
How can I 'resolve' the company name from the ContactID within a textbox? I
know it's possible in SQL - but howabout Access?!

I do not want to have to relate this form to a table as there is simply no
need.

Hope you can understand, TIA

Oli
 
Set the control source property of the text box to
=[Forms]![frm_Contacts]![CompanyNameField]
 
In frm_termchange's Open even, you could use DLookup to retrieve the Company
Name based on the value you're passing as the OpenArgs.
 

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

Similar Threads


Back
Top