Dirty

  • Thread starter Thread starter Tiny Tim
  • Start date Start date
T

Tiny Tim

I have a switchboard with many Buttons (Form Control) I tried to add a new
one but it would not work and says that "you have entered an expression that
has an invalid reference to the property Dirty".
Kindly help.
 
Open the code page for the form and look for the word Dirty. What do those
lines of code say?
Evi
 
Thank you. These are the words. I only have 15 commands. I deleted the
ones I made from the code page as well.

Private Sub Command78_Click()
On Error GoTo Err_Command78_Click


If Me.Dirty Then Me.Dirty = False
DoCmd.Quit

Exit_Command78_Click:
Exit Sub

Err_Command78_Click:
MsgBox Err.Description
Resume Exit_Command78_Click

End Sub
 
Change the middle bit so that it now reads
If Me.Dirty = True Then
Me.Dirty = False
DoCmd.Quit
End If

The Me.Dirty means that if info in the form has been changed (if Me.Dirty =
True) then save the changes (Me.Dirty = False) and close Access completely
(DoCmd.Quit)
If you still have a problem then you may have a reference problem.
See here for instructions on how to solve this.

http://allenbrowne.com/ser-38.html
Evi
 
Back
Top