Last Record On A Continuous Form (Problem)...

O

okcmagicman

Thanks in advance for reading this, and again for any help you can
offer.

I have a database where as the user does things, a table gets
populated. Let's call it tblData. At some point in the work process, a
form is called, frmProblem. This is a continuous form (with no
subforms) that is bound to tblData. Using textboxes, it correctly
displays the records from the table in a list.

This part works fine. To keep the user from entering a new record at
this point, the Allow Additions property of frmProblem is set to "No"
in the property sheet. This also works fine, and the display of the
recordset ends with the last record in the table.

The user can now tab through and edit any data in any of the fields.
As he does, data in the table is updated instantly. When he's
finished, he hits a SAVE button, and all the data from the table is
moved to a master table, and tblData is scrubbed.

All this works great...EXCEPT for the last record on the form. The
user can cleanly tab and edit all the way through, but when he gets to
the last record, he can only tab in a circle around and around the
fields in the last record. More of a problem, even if he changes or
enters new data in these fields, this new information is NOT written
to tblData, so it's not there in the table to be moved into the master
table when the code behind the SAVE button is evoked.

I can turn Allow Additions on, and the user can then get to that last
record just fine, and the data there appears in tblData just like it's
supposed to, but now the user can also enter data in a new record,
which isn't good.

I've not been able to find out why the last record doesn't update to
tblData. The fields, of course, are just repeats of the same field in
design view (being a continuous form), so I would expect the last
record to behave like all the others, but that's not the case.

Any ideas?

And thanks again....



Lance
 
R

Rob Parker

Hi Lance,

When the tab key is used to cycle through all records, it will always only
cycle through the fields in the last record if there is no new record to
move to. Any edits to the last record will not be saved until you move off
the record, and the tab key cannot do so. The way to solve your problem is
to explicitly save the record if it is dirty (ie, has been edited). So, in
the code behind your SAVE button, add the following (before any other code):

If Me.Dirty Then Me.Dirty = False

HTH,

Rob
 
O

okcmagicman

HTH? Rob, this worked perfectly. Thanks so much for such a clear,
concise and FAST response!

The navigation is still an annoyance, and I wish it would tab from the
last record to the next stop (which is the SAVE button), but the
really important thing is that the data is saved to the table.

I owe you.

Cheers,



Lance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top