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

Compile Error Expected : =

Status
Not open for further replies.

bopritchard

Programmer
Jan 27, 2003
199
US
in Form_1 i have a sub

Public Sub OpenForm(ByVal pSQL As String, ByVal pFilter As String)
Me.RecordSource = pSQL
Me.Filter = pFilter
Me.FilterOn = True
End Sub

in Form_2 on a onclick event i have
Form_1.OpenForm(filtername,whereclause)
which generates a compile error expected :=

why?
 
From Help:

'The OpenForm method carries out the OpenForm action in Visual Basic.

expression.OpenForm(FormName, View, FilterName, WhereCondition, DataMode, WindowMode, OpenArgs)'

('expression' would usually be DoCmd)
 
Replace this:
Form_1.OpenForm(filtername,whereclause)
with either this:
Call Form_1.OpenForm(filtername, whereclause)
or this:
Form_1.OpenForm filtername, whereclause

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top