Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enable after Update from Calendar

Status
Not open for further replies.

CCRT

Technical User
Jul 27, 2005
14
0
0
US
I can't seem to find the correct method to enable "Command8"

"TextEndDate" is the field on the form that is pouplated by a calendar.

I'm trying to make the Command8 object only available after the "TextEndDate" is populated.

Thanks

--Dave


Code:
Private Sub Form_Load()

Forms!frmDateCriteria.Command8.Enabled = False

End Sub




Private Sub TextEndDate_AfterUpdate()
'Enable Command8
    Forms!frmDateCriteria.Command8.Enabled = True
End Sub

 
Hi
I guess you are filling in TextEnddate with code. This will not cause the After Update Event to fire. You need to enable the control when you are setting the value for TextEnddate.
 
First off :-
"TextEndDate" is the field on the form
This cannot possibly be true as 'Fields' do not exist on forms. Fields exist in Tables. "Controls" exist on forms

If "TextEndDate" and "Command8" are both controls on the form "frmDateCriteria" then you can drop all the "Forms!frmDateCriteria" referencing - it is unnecessary

( Before you go too much further you really aught to rename Command8 to something more meaningful )

Then put the Command8.Enabled = True line at the end of the code that writes the data to the control.

What you ACTULLY need is something more like

Command8.Enabled = (Len(Nz(TextEndDate,"")) > 0)
so that Command8 gets disabled if TextEndDate gets cleared.


'ope-that-'elps.






G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top