Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fill in 2nd Textbox2 from Textbox1

Status
Not open for further replies.

PrimoSteve

Technical User
Aug 11, 2021
25
IE
Hello All,

I have an unbound form called Recs with 2 unbound textboxes

Textbox1 called ProductNo
Textbox2 called ProductCode

Textbox1 has the ProductID from the Products Table already filled in
I am trying to fill in Textbox2 with the ProductCode corresponding to the ProductID from the Products Table

Thanks in advance!
 
I would change the ProductID control to a combo box that has the ProductCode in its Row Source. You can the display the ProductCode using a control source of:

=[your combo box name].Column(x)

X is the column number beginning with 0 as the first column.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Or, instead of Textbox1 for ProductNo/ProductID, keep this data in a variable:
(if numeric, then)
[tt]Dim lngProductID As Long[/tt]
and use DLookup Function to get the value for the ProductCode

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
Hi Duane / Andy,

It's been awhile but I did use the the DLookup Function and it's working perfect!

Many thanks for the suggestion much appreciated,

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top