By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,490 Members | 892 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,490 IT Pros & Developers. It's quick & easy.

Last record of Access form not updating in table

P: 43
Hello all,
I have an issue with a form updating all records in a table except for the very last record for some reason.

A little background, I have an unmatched query that appends results to a table so that the records are updateable. I have a form that is based on this table, where the user updates the invalid fields on a form, and then an update query is ran to update the records in the master table. All of this works great, except for the last record on the form. I can't figure out for the life of me why this is the case. Even when I hit enter after changing the records, the table is not updating.

Does anyone have an idea? I assume it's an easy fix but it's making my brain hurt.

Thank you all!
Jan 31 '14 #1

✓ answered by dsatino

It's probably much simpler than you think. It sounds like the last record isn't updating because the control update event isn't being triggered.

My guess is that your form is continuous and that hitting the enter button moves to the next record, which does trigger the event. On the last record, there is no where to go and so the enter button does nothing.

I'd bet that if you simply take the cursor and select any previous record on the form after you've changed the last record then you'll find that it updates to the table successfully.

Share this Question
Share on Google+
7 Replies


dsatino
100+
P: 393
Why not just set the .recordsource of the form to the table and bind the form fields to appropriate table fields. Then you're editing the records directly and don't need the update query.

Basically, you're adding an extra step that's not necessary.
Jan 31 '14 #2

P: 43
Thanks for the response dsatino...

I should have clarified. I have a form bound to a table, as you suggested. As I update the form, the resulting fields in the table will also update. This works for all records except for the last record for some reason. I then take this table and run an update query to update these specific records into a larger table. I guess I did not need to specify this...

So if the form is bound to the table, why would all records update correctly except the last one? I am confused.

Thanks!
Jan 31 '14 #3

dsatino
100+
P: 393
Is the record failing to update in the form bound table, or just in the 'larger' table?
Jan 31 '14 #4

zmbd
Expert Mod 5K+
P: 5,287
Why the extra step?
Why not bind the form to the larger table to begin with?
You can then use the form's (or control level if needed) before_update event to validate the record before the edit is saved.
Jan 31 '14 #5

P: 43
Thank you for the responses...

The record is not updating in the bound table, so it's not an issue with the update query.

As far as the reasoning behind not having the form bound to the larger table is that:
1.) I run an unmatched query, which basically shows which records are invalid for a single field. One table imports data from our labor management (non-Access) database. Employees choose certain labor codes to use, so quite often they type in a labor code that does not exist, so the unmatched query finds invalid codes by matching the labor data against a table with all valid codes. The query is then unable to be updated, so that why I chose to append that table to a writable table and update it from there.
2.) The form and bound table are located on a front end, with the large table on a backend. I use this so multiple managers can pull hours at any time and get the most recent hours. I didn't want to have the form on the backend for obvious reasons

Hopefully this helps explain my problem and reasoning a little more. I will continue to try workarounds, but any help is always helpful!
Feb 1 '14 #6

dsatino
100+
P: 393
It's probably much simpler than you think. It sounds like the last record isn't updating because the control update event isn't being triggered.

My guess is that your form is continuous and that hitting the enter button moves to the next record, which does trigger the event. On the last record, there is no where to go and so the enter button does nothing.

I'd bet that if you simply take the cursor and select any previous record on the form after you've changed the last record then you'll find that it updates to the table successfully.
Feb 2 '14 #7

P: 43
Thanks again dsatino...

You were definitely right about pointing the cursor at a previous record for it to update- worked like a charm last night. Of course, when I ran this morning there was only 1 record that showed up haha. I just made a temporary change by changing the Allow Additions property to yes so hitting enter will move to a new record and update the table accordingly.

Much appreciated!
Feb 4 '14 #8

Post your reply

Sign in to post your reply or Sign up for a free account.