I have a form with a list box and a text box that both update a table to saves a value in a table which I use in some reports. Sometimes I know what the ClassID number is and just type it in the text box and press the button other times I select the ClassID from the list box.
This all works fine but what I want to add is the list box to have selected (hightlighted) the ClassID saved in the Table. Of course if I click on the item in the list I want it is selected but it does not work when I first open the form or if I type in the ClassID in the textbox and press the button.
I can't get it to work. Any help would be appreciated.
Thank you
Aaron
Table: Class_saved
ID
ClassID
List Box: Class_List
Default Value =[Class_saved]![ClassID]
On click:
Text box with button that also updates table Class_saved.
This all works fine but what I want to add is the list box to have selected (hightlighted) the ClassID saved in the Table. Of course if I click on the item in the list I want it is selected but it does not work when I first open the form or if I type in the ClassID in the textbox and press the button.
I can't get it to work. Any help would be appreciated.
Thank you
Aaron
Table: Class_saved
ID
ClassID
List Box: Class_List
Default Value =[Class_saved]![ClassID]
On click:
Code:
CurrentDb.Execute "Update Class_saved Set ClassID = " & Me.Class_List.Value & " where ID = 1", dbFailOnError
Text box with button that also updates table Class_saved.