Updating fields in a form (1 Viewer)

neileg

AWF VIP
Local time
Today, 15:51
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.
 

Sonja A

Registered User.
Local time
Today, 09:51
Joined
Jun 25, 2002
Messages
18
Try me.refresh in the after change property of the record you are adding... Maybe?!
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 10:51
Joined
Feb 19, 2002
Messages
43,480
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
 

neileg

AWF VIP
Local time
Today, 15:51
Joined
Dec 4, 2002
Messages
5,975
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

Top Bottom