Enabling SubForm of a form !

totolkhan

Registered User.
Local time
Yesterday, 20:18
Joined
May 23, 2005
Messages
30
what's wrong with this Code ?!

Private Sub Form_Current()
If Date = Null Then
Forms!getorder![Orders].Form.ProductID.Enabled = True
Else
Forms!getorder![Orders].Form.ProductID.Enabled = False
End If

End Sub



getorder is a Form
Orders is a Subforms

i want to do something that if i didn't entered a text in a date field hole subforms or Product id will be Disable

but if any texts enterd in Date Field it will be Enabled

thanks
 
Hey totolkhan,

See if this works for ya:

Private Sub Form_Current()
If Trim(Nz([Date],"")) = "" Then
Forms![getorder]![Orders].Form![ProductID].Enabled = True
Else
Forms![getorder]![Orders].Form![ProductID].Enabled = False
End If

End Sub

FYI, If you really do have a field named ' Date ' you should think seriously about changing it's name to something else. That is a reserved name in Access and can cause problems.

HTH,
Shane
 

Users who are viewing this thread

Back
Top Bottom