Form recordsource not updating - 2003

PaulW
2StarLounger
Posts: 125
Joined: 17 Feb 2010, 16:25

Form recordsource not updating - 2003

Post by PaulW »

I have a form whose recordsource is qryTrainingQualification. This query is a join between People Table and ShopQualification. Join properties are defined as the second radio button.

The issue: When I click a checkbox whose control source is a field in the query, the field in ShopQualification is not updated. To further elaborate, when there is no record in ShopQualification, my form does not create one, as I would expect it to do.

Attached please find a stripped down zipped copy of the mdb file. The form in question is frm1-2-0 ConferQualifications.

Thanks in advance.
You do not have the required permissions to view the files attached to this post.
PaulW
Lost Wages, NV USA
(former Cobol Programmer)

User avatar
HansV
Administrator
Posts: 78391
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Form recordsource not updating - 2003

Post by HansV »

Ticking a check box doesn't automatically create a value for the primary key tbl330BadgeNbr, so there is no real record that can be saved.

As it is now, the tables are linked on tbl330ID vs tbl330BadgeNbr. Each of these fields is the primary key in its respective table, so you get a one-to-one relationship: for each record in People Table, there can be only one record in ShopQualification and vice versa.

If that is what you intended, it would be better to combine the two tables into one: all fields from ShopQualification can be added to People Table. This would make things much easier: you wouldn't have to join tables, and the form would behave as you expected.
Best wishes,
Hans

PaulW
2StarLounger
Posts: 125
Joined: 17 Feb 2010, 16:25

Re: Form recordsource not updating - 2003

Post by PaulW »

Hans,
Thanks for the answer.

I understand what you are saying about the "People Table" and no "ShopQualification" associated entry. This I can handle; BUT, the big question is when there is a shop qualification record in the query whose id matches an id in the people table, why do I have to get out of the form for the entry to be updated in the ShopQualification table? For example, when I select id #41 from the combo box on the form, there is a record for that id in both tables. I don't understand why the record in the ShopQualification table is not updated immediately when I click any checkbox on the form. The ShopQualification record for that id is updated after I leave the form. When I check the table after I exit the form, the correct entry has been updated.
PaulW
Lost Wages, NV USA
(former Cobol Programmer)

User avatar
HansV
Administrator
Posts: 78391
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Form recordsource not updating - 2003

Post by HansV »

This is standard behavior - when you edit a record, for example by ticking or clearing a check box, the change is kept in your computer's memory, and the record is only saved to the table when one of the following occurs:
- You move to another record in the form, or
- You close the form, or
- You explicitly save the record by selecting Records | Save Record.

Under normal circumstances you never have to worry about saving a record, it will done automatically for you when you move on. Saving the record at every change is generally undesirable, for (1) it causes unnecessary overhead, and (2) it would make it more difficult to undo changes.
Best wishes,
Hans

PaulW
2StarLounger
Posts: 125
Joined: 17 Feb 2010, 16:25

Re: Form recordsource not updating - 2003

Post by PaulW »

Hans,
Again you make it sound so simple. Thank you.
PaulW
Lost Wages, NV USA
(former Cobol Programmer)