Updating fields in a form

neileg

AWF VIP
Local time
Today, 17:55
Joined
Dec 4, 2002
Messages
5,975
I think these questions are pretty basic, as I've done much more complicated things before. But now I've got brain fade!

I have a form to enter new records in a single table. I want the user to selct a value from a two column combo box that is derived from a different table. Once the value is selected, I want to update two fields in the table with the matching values in the two columns. I've got the combo box working on one field but how do I update the other with the second value. (I need the two values even though they are always synchronised, because they get concatenated with other fields. I dont mind if the two fields are shown on the form, or just the combo box with the selected values.

Next question:
I have a field that has a list box derived from a query based on the table that I am updating. Once I have entered a record, I want the value to be available in the list box when creating the next record. How do I refresh the query without having to close my form and reopen it?

Thanks for any help.
 
Try me.refresh in the after change property of the record you are adding... Maybe?!
 
1. The second field does not need to be stored. You can retrieve it as necessary by using a query that joins to the table.

2. In the AfterUpdate event of the form, requery the listbox:

Me.YourListBox.Requery
 
Thanks, Pat

Thanks for the requery hint. Now I know, I don't know why I didn't know in the first place!

Yes you're quite correct about retrieving the second field. Shame on me!
 

Users who are viewing this thread

Back
Top Bottom