Set Forms Property

  • Thread starter Thread starter ainow
  • Start date Start date
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
 
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.
 
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.
 
Back
Top