me.dirty

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
Are you aware that Access *will* save any records that need saving before
moving to a new record?
 
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
 
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.
 
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
 
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]
 
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]
 
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
 
Back
Top