I have a form that has two combo boxes that display a persons first and last name. Those combo boxes are pulled from the names table. Based on what value the user chooses, the appropriate name ID is stored in the application table.
That is fine and dandy for creating a new record. However, if a user is viewing an existing record, choosing a different name in the combo box changes the name ID. Instead of editing the existing record I want the user to go to a record of the newly selected ID.
The solution that I came up with seems like it might be overkill. I thought I would see what everyone thinks before I go to the trouble of coding it all.
On entry on either of the combo boxes, the name id is stored in a variable.
On losing focus the code compares the current name ID to the stored name ID. If they are different, the change is reverted to the original name ID(undo). After that the code will change the record being viewed to one that is associated with the 'new' name ID.
I'm still pretty new to Access so I might be missing something obvious. Any advice/suggestions would be most welcome!
That is fine and dandy for creating a new record. However, if a user is viewing an existing record, choosing a different name in the combo box changes the name ID. Instead of editing the existing record I want the user to go to a record of the newly selected ID.
The solution that I came up with seems like it might be overkill. I thought I would see what everyone thinks before I go to the trouble of coding it all.
On entry on either of the combo boxes, the name id is stored in a variable.
On losing focus the code compares the current name ID to the stored name ID. If they are different, the change is reverted to the original name ID(undo). After that the code will change the record being viewed to one that is associated with the 'new' name ID.
I'm still pretty new to Access so I might be missing something obvious. Any advice/suggestions would be most welcome!