I have a combo box and several text boxes on a form. When I select a value from the combo box I want it to run a query based on that value and populate the text boxes with the data returned by the query. The query should only return one record and the textboxes correnspond to different columns in that record.
I have this code:
Private Sub cbo_equip_loc_Change()
Dim location As String
Me.cbo_equip_loc.SetFocus
location = DLookup("NAME", "Query1", "position = '" & Me.cbo_equip_loc.SelText & "'")
Me.Text51.SetFocus
Me.Text51.Text = location
End Sub
But I get this error: "This property is read-only and can't be set"
Any ideas?
Solved: Im an idiot.
I had some value in the Control Source from something I was trying to do before. Removed that and it worked!