me.dirty

G

Guest

I have where the user can optionally enter information in text boxes. There
are command buttons that move the user to the next form to enter more data.
I want to prompt the user to save information if they have entered data
before moving on to the next form. I attempted the following, but got an
error (2455)

If Me.Dirty Then
Msg = "Do you want to save your changes?"
Title = "Save Changes?"
Response = MsgBox(Msg, vbYesNo, Title)
If Response = 6 Then
GoSub update_actual
End If
End If
 
R

ruralguy via AccessMonster.com

Are you aware that Access *will* save any records that need saving before
moving to a new record?
 
J

John Welch

I'm assuming that you're not closing this form when moving to the next form.

What line generates the error? You didn't show the code for update_actual.

You can just say:
if response =6 then
me.dirty=false

and the record will be saved.
hope this helps
-John
 
G

Guest

I am aware of that. The form reads in the first 11 records and moves various
fields to the appropriate Caption controls of the label field. The text
boxes allow the user to enter information that will be saved to a different
table. On the form there is a next button, when the user clicks it, the next
11 records are displayed on the same form, so any data entered in the text
boxes is lost.
 
G

Guest

Correct. I am basically refreshing the screen and displaying the next 11
records. The text boxes allow the user to make entries. These entries are
stored in a different table. The actual line that generates the error is:

If Me.Dirty Then
 
R

ruralguy via AccessMonster.com

It sounds like you are using unbound forms in which case the AutoSave of
Access will *not* work. You need to do all of the work yourself. I don't
know what error 2455 is but my guess is that Me.Dirty does *not* mean
anything with unbound forms. Am I correct in my assumptions?
I am aware of that. The form reads in the first 11 records and moves various
fields to the appropriate Caption controls of the label field. The text
boxes allow the user to enter information that will be saved to a different
table. On the form there is a next button, when the user clicks it, the next
11 records are displayed on the same form, so any data entered in the text
boxes is lost.
Are you aware that Access *will* save any records that need saving before
moving to a new record?
[quoted text clipped - 13 lines]
 
J

John Vinson

Correct. I am basically refreshing the screen and displaying the next 11
records. The text boxes allow the user to make entries. These entries are
stored in a different table. The actual line that generates the error is:

If Me.Dirty Then

If it's an unbound form then it cannot be dirtied, right!?

John W. Vinson[MVP]
 
G

Guest

Yes it is an unbound form, so you are correct. Thanks.

ruralguy via AccessMonster.com said:
It sounds like you are using unbound forms in which case the AutoSave of
Access will *not* work. You need to do all of the work yourself. I don't
know what error 2455 is but my guess is that Me.Dirty does *not* mean
anything with unbound forms. Am I correct in my assumptions?
I am aware of that. The form reads in the first 11 records and moves various
fields to the appropriate Caption controls of the label field. The text
boxes allow the user to enter information that will be saved to a different
table. On the form there is a next button, when the user clicks it, the next
11 records are displayed on the same form, so any data entered in the text
boxes is lost.
Are you aware that Access *will* save any records that need saving before
moving to a new record?
[quoted text clipped - 13 lines]
End If
End If

--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
 

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