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!

Hide multiple command buttons

Status
Not open for further replies.

Fish521

Technical User
Nov 3, 2005
29
US
Hello
I'm trying to hide multiple command buttons on a form until required fields are completed. I have been successful in hiding them based on 1 field but not sure how to go about hiding them until all the required fields are filled out. Any help would be great.

Thanks,
 
I think the best bet would be to create a routine that checks the required controls and turns the command buttons on, if the check validates. You will need to run it for each required field. The After Update event should suit. You can use the Tab property of the controls to show that they are required.
 
I have the fields set to required in the table. I'm not sure how to go about setting up a routine to check the fields. Any example you could give me would be great
 
Loop through the controls collection for the form:

Code:
blnOK=True
For each ctl In Me.Controls
If ctl.Tab="Req" Then
    If IsNull(ctl) Then
        blnOK=False
    End If
End If
Next

If blnOK Then
   'Switch command buttons on
End If
 
Stupid question where is the tab property located at? I can not find it anywhere under the properties of fields
 
I think that Remou meant the Ta[!]g[/!] property ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top