list box value not saved to underlying table

callaway

New member
Local time
Today, 23:20
Joined
Feb 9, 2002
Messages
9
:confused: I have a list box whose record source is a query based on a value selected in a combo box.
when the value in the combo box changes the list box is requeried to show the updated value.
this all works fine but when i come to save the record the table entry correcsponding to the list box value IS NOT UPDATED.
It would appear to be because the value in the list box is not "selected"?
How do I ensure the value in the list box is automatically selected in code?

thanks
 
Sounds to me like you're over engineering this thing. If the List Box is supposed to have the value selected based on what is selected via the combo box, why not just have a text box instead of the list box and set the value of the text box in the combo box's On Change event. The text box should be bound to the table or query field so that it will update the table when the selection is made.

BL
hth
 
Thanks Bob

You are probably right that I am trying to over engineer this.

I had thought that I needed to use list boxes for this type of update since it can take a query as a row source.
I guess what I had not considered is that I could use the on change event in the combo to run the query and then populate the text box directly - I guess this is what you are saying?
Anyway I did get the list box working in the end following a post I made on QuickTechUSA by doing ...

lstBox.selected(0)=true


Thanks
 

Users who are viewing this thread

Back
Top Bottom