View Single Post
Old 07-15-2019, 03:47 AM   #5
machinetech
Newly Registered User
 
Join Date: Jun 2019
Posts: 7
Thanks: 2
Thanked 0 Times in 0 Posts
machinetech is on a distinguished road
Re: How to make a text box to perform as a combo/list box

Quote:
Originally Posted by MajP View Post
If I understand this correctly, then simply do this in the forms on current event instead of the controls recordsource. Bind the control to the correct recordsource. In the forms on current event something like

Code:
if isnull(me.someTextbox) then
  me.someTextbox = yourDlookupFormula
end if
This is essentially what I did.
In the "On Change" Event Procedure for the preceeding combo box, I put in a dlookup function that looked like this:

Code:
Private Sub Combo1_Change()
     Text1 = Dlookup("[Field]", "Query")
End Sub
So this controls the input into the textbox, while I can still have the control source to the field the form is tied to.

Essentially a text box with a control source, that acts like a combo/list box with a row source.
machinetech is offline   Reply With Quote