Auto Fill Textboxes based on Entry (dlookup) and save results to table (1 Viewer)

DeltaD

New member
Local time
Today, 17:51
Joined
Apr 11, 2021
Messages
12
Alright wizards,
Got another one that's been stumping me. I've attached a sample database to help with the explaining. I'd like the "location" and "pick aisle" fields in the form to auto fill based on the "material" field which my users will add in manually. I've got the dlookup function to work before but it won't save that data from those fields into the Table the form is based off of (running log record)
any assistance would be spectacular!
 

Attachments

  • example database.accdb
    3.5 MB · Views: 224

pbaldy

Wino Moderator
Staff member
Local time
Today, 14:51
Joined
Aug 30, 2003
Messages
36,118
It would be simplest with a combo box:


If that's impractical (keep in mind the user doesn't need to scroll/select, they can type in a value), you can use your DLookup() with the second method.
 

DeltaD

New member
Local time
Today, 17:51
Joined
Apr 11, 2021
Messages
12
So I would make the "Material" area a combo box and then the "location" and "Pick Aisle" area would be Dlookups?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 14:51
Joined
Aug 30, 2003
Messages
36,118
If you made it a combo, you'd add those two fields to it and use the method described in the link. DLookup() can work but each would involve another trip to the data, less efficient when the combo has already done it.
 

DeltaD

New member
Local time
Today, 17:51
Joined
Apr 11, 2021
Messages
12
This nearly works perfectly! When I hit save, It pulls the ID number of that material I listed and saves it to the table instead of the Material. Any thoughts?

Solved it! Changed the bound column to 2 and now it works perfectly!!

Thank you!
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 14:51
Joined
Aug 30, 2003
Messages
36,118
Happy to help! I should point out that typically you store ID numbers in related tables, not the text value. That's one of the reasons for an ID field.
 

Users who are viewing this thread

Top Bottom