Automatically filling in control based on another control's value

G

Graeme

I am trying to find out how to have a form control
automatically fill in it's value based on a value chosen
from a separate combo control. For example, I want to
chose a property name in a combo control and then have it
automatically fill in the separate control for property id
based on data in a table that stores both the property
name and id fields.

I know it is probably really simple but it's late in the
day and I am having problems trying to work this one out.
 
N

Nikos Yannacopoulos

Graeme,

Use the Before Update or On Change event of the combo box to run a Macro
utilising action SetValue, arguments: Item > The name of the control to be
filled, Expression >
DLookup("[Property_id]","tblProperties","[Property_Name]=[Forms]![FormName]!
[Property_Name]")
substituting with the actual fierlds, table, form and control names.

HTH,
Nikos
 

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