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

Passing forms as arguments

Status
Not open for further replies.

rdharmar

IS-IT--Management
Jun 20, 2001
54
US
I need to pass a form as an arguments to sub routine in a Module. I get a type mismatch error? What's wrong with this?
Thanks!

in the Form module:

loadListBox(frmABC)


in the BAS Module:

Sub loadListBox(formName as form)

End Sub
 
change the syntax of the call to either one of the following

loadListBox frmABC ' no parens

or

call loadlistbox (frmABC) ' with parens


Good Luck
------------
Select * from Users where Clue > 0
0 rows returned
 
Try something like this...
in the Form module:

Call loadListBox(frmABC)


in the BAS Module:

Sub loadListBox(Source as Control)

If TypeOf Source Is Form Then
With Source
.Caption = "This is My Form"
End With
End If

End Sub

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top