Access 2016: Updating table with subform (1 Viewer)

tonylomax

Registered User.
Local time
Today, 09:19
Joined
Oct 19, 2018
Messages
16
In my database I have a main form view and a subform that allows each individual record/person to have various 'keywords' assigned with that person. Each Keyword can be assigned to multiple people and people can have more than one keyword so I have a junction table set up to model the many-to-many relationship.

The subform is linked to this junction table. When I try and update the subform (and in turn the table) the ID for each keyword is entered into the Keyword field on the junction table, rather than the the actual keyword itself. This messes up all subsequent searches which rely on the user inputting the actual keyword.

I'm aware this is quite ambiguous at the moment, happy to provide sample databases' but for now is this something that anybody else has come across/any ideas why this might be happening?

Thanks
 

theDBguy

I’m here to help
Staff member
Local time
Today, 01:19
Joined
Oct 29, 2018
Messages
21,467
Hi. What you have described, if I understood it correctly, is actually correct. The ID values should be what you save in the junction table. If you want to do searches, then you'll need to use a query. However, are you talking about the user doing searches on the same subform where you're entering the keywords for the person? If so, are you using a combobox? If so, then it shouldn't be problem. You can use the hidden lookup column of the combobox in your search. I forgot the syntax, let me look it up...
 

tonylomax

Registered User.
Local time
Today, 09:19
Joined
Oct 19, 2018
Messages
16
Thanks for the reply. I managed to create a temporary workaround which is another combo box where the control source is the Keyword text field. The user has to make 2 identical changes on the subform to ensure the table has the correct data. This combo box doesn't update the related ID in the table which is required for the search. But this implies it's possible.

I'd rather not go back and change all my queries to search for ID not keyword using aliases etc. An older version of the database worked in the way I describe but used a multi-valued field which I was explicitly trying to move away from.
 

Users who are viewing this thread

Top Bottom