Autopopulate 1 field based on another


D

DM - NPS

I think this is easy but could not figure it out and was not able to find it
when searching this site.

I have a form (frmNames) that has two fields (First, Last). The last name
field is a combo box and the list of values is contained in a field called
last in a table called luNames. The table luNames has 2 fields (first, last)

What I want is when someone selects a last name on the form, the first name
also populates.

Thanks
 
Ad

Advertisements

D

David

DM,
There are several ways. If frmNames is bound to luNames table, you can use
the wizard to add a combo box and choose the option to Find a record on my
form...........

You can also have the last name combo box contain two columns of data (first
and last name), with the last name being bound to the combo box. In the
after update event of the last name combo box, write code that copies
cbo_lastname.column(1) to firstname.

Attributes of cbo_lastname
Row Source-SELECT [luNames].[Last], [luNames].[First] FROM [luNames] ORDER
BY [Last];

Column Count-2
Column Width 1";1"
Bound Column-1


In cbo_lastname after update event,

Me.First = Me.cbo_lastname.Column(1)


Hope this helps.
 

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


Top