Set Forms Property

A

ainow

Is there a way to use passed parameters to set “Forms†property?

Private Sub SetFormsProperty(formName AS ???, fieldName AS ???)

Forms.formName.fieldName.Visible = True

End Sub

If yes what is the syntax and what type variables would formName and
fieldName be?

Thanks
Jim
 
D

Douglas J. Steele

Private Sub SetFormsProperty(formName AS String, fieldName AS String)

Forms(formName).Controls(fieldName).Visible = True


This will, of course, fail if the form isn't already open.
 
A

ainow

Doug

Thanks, that works.

Jim

Douglas J. Steele said:
Private Sub SetFormsProperty(formName AS String, fieldName AS String)

Forms(formName).Controls(fieldName).Visible = True


This will, of course, fail if the form isn't already open.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top