Dirty

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.
 
E

Evi

Open the code page for the form and look for the word Dirty. What do those
lines of code say?
Evi
 
T

Tiny Tim

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
 
E

Evi

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top