HKFuey
asked on
Access save bound form record
I have this: -
It gives error 2455 "You entered an expression that has an invalid reference"
I am trying to get a bound form to save after a box is ticked. Can anyone help?
If Me.Dirty = True Then
DoCmd.RunCommand acCmdSave
End If
It gives error 2455 "You entered an expression that has an invalid reference"
I am trying to get a bound form to save after a box is ticked. Can anyone help?
Try acCmdSaveRecord
If Me.Dirty = True Then
DoCmd.RunCommand acCmdSaveRecord
End If
ASKER
Sorry for not being clear, it errors on line 1
If Me.Dirty = True Then
If Me.Dirty = True Then
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Where is your code located?
If it is not on the form, you'll need the full reference:
Forms!YourFormName.Dirty
If it is not on the form, you'll need the full reference:
Forms!YourFormName.Dirty
ASKER
Hi mbizup,
Tried the form name, I still get the error, if I take out the if statement and just leave: -
DoCmd.RunCommand acCmdSaveRecord
It seems to work OK
Tried the form name, I still get the error, if I take out the if statement and just leave: -
DoCmd.RunCommand acCmdSaveRecord
It seems to work OK
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just for kicks, try the same thing on a new (or different) form.
If Me.Dirty = True Then
Me.Dirty = False
End If
/gustav