Me.dirty

G

Guest

Hello,

I have placed the following code in the on current event of a form:

Private Sub Form_Current()
If IsNull(Me.DRM_Id) Then
Me.Drawing_Management_DRM_Ref_Doc_SubFrm.Visible = False
Else
Me.Drawing_Management_DRM_Ref_Doc_SubFrm.Visible = True
End If
End Sub

And this so as to ensure that the form are not available to the user until
they enter the bare minumum of required information. However, I want to
render the subfrm visible the second they enter any information in any field
of the form. I thought the On Dirty event would achieve this but I can't
seem to get it to work?! Any ideas?

I had used the following coding for the on dirty event:

If Me.Dirty Then
Me.Drawing_Management_DRM_Ref_Doc_SubFrm.Visible = True
End If

Thank you,

Daniel
 
D

Dirk Goldgar

Daniel said:
Hello,

I have placed the following code in the on current event of a form:

Private Sub Form_Current()
If IsNull(Me.DRM_Id) Then
Me.Drawing_Management_DRM_Ref_Doc_SubFrm.Visible = False
Else
Me.Drawing_Management_DRM_Ref_Doc_SubFrm.Visible = True
End If
End Sub

And this so as to ensure that the form are not available to the user
until they enter the bare minumum of required information. However,
I want to render the subfrm visible the second they enter any
information in any field of the form. I thought the On Dirty event
would achieve this but I can't seem to get it to work?! Any ideas?

I had used the following coding for the on dirty event:

If Me.Dirty Then
Me.Drawing_Management_DRM_Ref_Doc_SubFrm.Visible = True
End If

Thank you,

Daniel

When the Dirty event fires, the form is not actually dirty yet. So just
take out your If statement:

'----- start of replacement code -----
Private Sub Form_Dirty(Cancel As Integer)

Me.Drawing_Management_DRM_Ref_Doc_SubFrm.Visible = True

End Sub
'----- end of replacement code -----
 
D

Daniel

Worked beautifully, thanks for the help!

Daniel

Dirk Goldgar said:
When the Dirty event fires, the form is not actually dirty yet. So just
take out your If statement:

'----- start of replacement code -----
Private Sub Form_Dirty(Cancel As Integer)

Me.Drawing_Management_DRM_Ref_Doc_SubFrm.Visible = True

End Sub
'----- end of replacement code -----

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 

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