G
Guest
I am currently using Access 2007 – when I am creating a form control button
within a form I have a tendency to use the wizard, select the category “form
operations†and the action “close form†– I tend to name the button cmd_close
for each form.
When I try to use the button in the form view I am getting the error message
“You entered an expression that has an invalid reference to the property
Dirty,†this has only started to occur since I switched over to 2007 –
although my default save format is set to Access 2002 -2003.
The script behind the event is:
Private Sub cmd_close_Click()
On Error GoTo Err_cmd_close_Click
If Me.Dirty Then Me.Dirty = False
DoCmd.Close
Exit_cmd_close_Click:
Exit Sub
Err_cmd_close_Click:
MsgBox Err.Description
Resume Exit_cmd_close_Click
End Sub
To avoid this happening I have simply been using a DoCmd.Close behind the
“on click†event and avoiding the wizard all together. I have no idea what
the Me.Dirty expression means – can you give me any pointers? I know enough
to understand the function of the Me part of the expression but despite
searching through books and online cannot find an explanation of the Dirty
part. I have seen this expression in a number of strings and would be
grateful if someone can explain its function and why its preventing me using
a command button created through the wizard in Access 2007.
Many thanks.
within a form I have a tendency to use the wizard, select the category “form
operations†and the action “close form†– I tend to name the button cmd_close
for each form.
When I try to use the button in the form view I am getting the error message
“You entered an expression that has an invalid reference to the property
Dirty,†this has only started to occur since I switched over to 2007 –
although my default save format is set to Access 2002 -2003.
The script behind the event is:
Private Sub cmd_close_Click()
On Error GoTo Err_cmd_close_Click
If Me.Dirty Then Me.Dirty = False
DoCmd.Close
Exit_cmd_close_Click:
Exit Sub
Err_cmd_close_Click:
MsgBox Err.Description
Resume Exit_cmd_close_Click
End Sub
To avoid this happening I have simply been using a DoCmd.Close behind the
“on click†event and avoiding the wizard all together. I have no idea what
the Me.Dirty expression means – can you give me any pointers? I know enough
to understand the function of the Me part of the expression but despite
searching through books and online cannot find an explanation of the Dirty
part. I have seen this expression in a number of strings and would be
grateful if someone can explain its function and why its preventing me using
a command button created through the wizard in Access 2007.
Many thanks.