MamadouNdaw
Registered User.
- Local time
- Today, 16:30
- Joined
- Nov 14, 2007
- Messages
- 17
I have a simple database that acts as a dictionary. There is a One to Many relationship between the word-list table and the definitions table. Each table has an AutoNumber field as the primary key.
I have setup a query to display all of the words in the dictionary and their corresponding definitions. This query is the record source for my dictionary editing form. I have added all the relevant fields without adding the primary key fields, as they are autonumber fields.
When adding a new word to the dictionary, the primary key field on the one side of the relationship does not append, causing an error (null value not allowed for the primary key of the word-list table) when switching to the subform for the 'many' side of the relationship. I would like for the autonumber field to update automatically upon making a new entry.
Using "DoCmd.RunCommand acSaveRecord" after update does not cause the autonumber field to append. I know there must be a simple snippet of code that lets appends to the autonumber field.
Note: This does work when using the corresponding tables as the record source. But, it creates an error when attempting to delete an entry. I prefer to pass through the query.
Thanks Guys
I have setup a query to display all of the words in the dictionary and their corresponding definitions. This query is the record source for my dictionary editing form. I have added all the relevant fields without adding the primary key fields, as they are autonumber fields.
When adding a new word to the dictionary, the primary key field on the one side of the relationship does not append, causing an error (null value not allowed for the primary key of the word-list table) when switching to the subform for the 'many' side of the relationship. I would like for the autonumber field to update automatically upon making a new entry.
Using "DoCmd.RunCommand acSaveRecord" after update does not cause the autonumber field to append. I know there must be a simple snippet of code that lets appends to the autonumber field.
Note: This does work when using the corresponding tables as the record source. But, it creates an error when attempting to delete an entry. I prefer to pass through the query.
Thanks Guys