On click and auto update for a field in a form

C

Chris

Can anyone help?

I have created a field with the following code in the "on click" function
for this field:

Private Sub Text5_Click()
Text5 = DLast("[QAR No]", "qry_QARNo_Value") + 1
End Sub

This code automatically updates the QAR No. to the next sequential number
that should be used for a user to fill out a new record so they don't have to
look up what the new number should be everytime. After they open up a new
record in a form and click in this field it gives them the new QAR No.,
however, if while they are filling out the new record in this form they click
in the QAR number field again it updates the QAR No to the next sequential
number and the old number is gone. If you try to search for any records with
that old number you can't find any because it somehow deleted that old
number. The current solution I'm using isn't a good one. I'm telling people
that they should close out of the form when they're done and reopen it before
clicking in the field for the new QAR No.

How do I fix this?
 

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