Re: pass arguments to function



VB syntax is funny. Normally you mustn't use parentheses round the
argument list of a sub procedure. Try

QuickSearch Me.ID, "vwSMKPatientLookUp", "nm"

This asssumes Me.ID is a control or field on the form and the other two
arguments are string literals. If they're variables, omit the quotes.

On Sat, 14 May 2005 10:09:13 -0700, "smk23"
<smk23@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

>I am passing values for search criteria, query and sort order for the query
>via this code:
>
>Public Sub QuickSearch(strSearch As String, qry As String, ord As String)
>
>When I try to pass values to the function using this line, I get a syntax
>error.
>
> QuickSearch("Me.ID", "vwSMKPatientLookUp", "nm")
>
>The message says there is a "=" sign missing. I've tried it with and without
>the quote marks. Me.ID is a string value the user types in.
>
>Thanks for looking at this.
>
>sam

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
.



Relevant Pages

  • Replace-Function with Sybase?
    ... as varchar. ... the attribute I need to query for is a string with 30 Digits. ... " Incorrect syntax near the keyword 'REPLACE'. ...
    (comp.databases.sybase)
  • Re: updating field with data from other fields
    ... "space" in the string. ... it should have been an "Update" query. ... > the syntax does look a little confusing with those in there ... >> Al Camp ...
    (microsoft.public.access.gettingstarted)
  • Re: validate sql syntax
    ... > do you use a single method for all types of query? ... and need to just verify that the syntax of the string ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Problems with Delete Command
    ... The SQL could get fairly messy if you need to construct it in code, ... ContactID, and WebComID, and create your on-the-fly SQL on that saved query, ... to find the list of ContactIDs from the junction table, ... This is a style/readability thing: if you are going to use string ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Need help with Code Please!!!
    ... the actual string that gets built at the end of the SQ1 build process. ... The message says Syntax error in query expression ... Dim rs As Recordset 'object ref to qryCompany\USFNumber ...
    (microsoft.public.access.formscoding)