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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling a Form Procedure from outside 1

Status
Not open for further replies.

pcdaveh

Technical User
Sep 26, 2000
213
US
I have a form. The form has a procedure in it that makes a text box that is normally not visible, visible. The focus is then set to that text box. This procedure is declared as Public in the form. I'm trying to activate this procedure from a function that is in a module separate from the form. I'm having trouble getting the function to run the procedure in the form. The function is a date manipulation function. It grabs the date from a text box that is normally hidden on the form. Recap: Thus, I'm trying run some code outside of the form and in doing so I have to make a text box visible w/ the focus. Then return to the Function. Then make the text box not visible again.
 
Make the procedure a Public Function. Something like this:

Public Function HideTextBox(frm as Form, ctl As control)as
If 'Your Logic Then
forms.frm.ctl.visible = True
Else
forms.frm.ctl.visible = False
End If
End Sub


From your forms:

Call HideTextBox(Me,txtYourControl)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top