D
Dymondjack
Question... I'm trying to set Me.Dirty = False on a btnClick event (in hopes
of being able to use DoCmd.GoToRecord,,acNewRec without the 'Cant go to
specified record' error), but when the code runs I get error 2101: "The
setting you entered isn't valid for this property.
Here's the code:
*****
Private Sub btnNxtNo_Click()
Me.Dirty = False '<=== GETS ERROR ON THIS LINE
DoCmd.GoToRecord , , acNewRec
Me.ctlOHRev = 0 'Set the Rev to 0
Me.ctlOHCustID.SetFocus 'Put Focus on Customer field
End Sub
*****
I also tried:
If Me.Dirty = True then
Me.Dirty = False
End If
Either one of these will work if the button is only pressed once, but if no
changes are made to a new record and the button is pressed again is when I
get the 2101 err (or 'Cant go to specified record' if I omit the Me.Dirty
lines)
Any ideas greatly appreciated... I know this is a fairly common scenario but
looking through back posts hasn't seemed to help.
Thanks
Jack
of being able to use DoCmd.GoToRecord,,acNewRec without the 'Cant go to
specified record' error), but when the code runs I get error 2101: "The
setting you entered isn't valid for this property.
Here's the code:
*****
Private Sub btnNxtNo_Click()
Me.Dirty = False '<=== GETS ERROR ON THIS LINE
DoCmd.GoToRecord , , acNewRec
Me.ctlOHRev = 0 'Set the Rev to 0
Me.ctlOHCustID.SetFocus 'Put Focus on Customer field
End Sub
*****
I also tried:
If Me.Dirty = True then
Me.Dirty = False
End If
Either one of these will work if the button is only pressed once, but if no
changes are made to a new record and the button is pressed again is when I
get the 2101 err (or 'Cant go to specified record' if I omit the Me.Dirty
lines)
Any ideas greatly appreciated... I know this is a fairly common scenario but
looking through back posts hasn't seemed to help.
Thanks
Jack