Autofill textboxes based on combobox value (1 Viewer)

Simona14

New member
Local time
Today, 14:46
Joined
Apr 28, 2018
Messages
1
Hi! I'm trying to populate text boxes based on a text in a combobox. I've tried using a dlookup in the textbox's control source but i can not figure out what i'm doing wrong. The values in the combobox are populated with the table "Persons" Region value.
=DLookUp(“[Name]”,”Persons”,”[Persons].[Region] = “”” & [Combo17].[Text] & “”””)
 

moke123

AWF VIP
Local time
Today, 17:46
Joined
Jan 11, 2013
Messages
3,912
First thing you should do is change the name of the "Name" field as that is a reserved word.

there are several ways to achieve what you want and a little difficult to understand with so little info.

Does your Dlookup return what you want?
if so you can use it in the after update event of the combo with something like
Me.YourTextBoxName = DLookUp("YourField","YourTable","YourCriteria")
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 05:46
Joined
May 7, 2009
Messages
19,229
Is your form bound?
What is the rowsource if combobox?
What is the recordsource of your form?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 17:46
Joined
Feb 19, 2002
Messages
43,233
Here's an example that shows how to do this. Look at example 4.
 

Attachments

  • FillFormFields.zip
    333.2 KB · Views: 54

Users who are viewing this thread

Top Bottom