Hi, Fred. Welcome to P2P!
To enable a button only when a textbox is filled, put this on the form's ON CURRENT event and also in the textbox's AFTER UPDATE event.
Me.cmdMyButton.Enabled = Not IsNull(Me.txtMyTextBox)
Where you put your REAL names for cmdMyButton and txtMyTextBox. Basically, if the textbox is empty (null), the ISNULL function returns TRUE. The NOT in front turns the TRUE into FALSE. Therefore, the enabled becomes FALSE and button dims. If the textbox is not empty ISNULL returns FALSE. The NOT turns that into a TRUE, the enabled property turns into TRUE, and the button can be clicked.
Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
|