ComboBox Not Updating

4star

New member
Local time
Today, 21:30
Joined
Jul 19, 2019
Messages
11
I have a form in a Database that has a combobox on it with two fields. When an item is selected it shows the first column in the combobox and then shows the second column in a textbox next to the combobox for the user to see. A button then runs a query based on the selections in the combobox.

This all works fine, however, after the query is run and closed, if you then change the selected in the combobox the textbox doesn't update, we've tried putting the [Event Procedure] in AfterUpdate and other parts of the Event properties but it just doesn't seem to do anything.

Could anyone help, please?
 
you should use the Combo's AfterUpdate:

private sub combo_afterupdate()
me![textboxname] = null
if me!combo.listindex > -1 then
me![textboxname] = me!combo.column(1)
end if
end sub
 
That's worked brilliantly, thank you!
 
For some reason, what once worked, now we can't get it to run, on changing the data in the combobox Access now throws out "Run time error 2448 - You can't assign a value to this object."
 
go to the form in Design View, and click on the Textbox.
on its property->Control Source, remove everything (i suppose you have and Expression in there
like "=combo.column(1)").
 
Access now throws out "Run time error 2448 - You can't assign a value to this object."
What is the textbox's name, and what is your current combobox code?
 

Users who are viewing this thread

Back
Top Bottom