Parameter Query - Pass value from Form Field with Like

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm looking to pass a value from a form to a query using something like the
following:

Like *[forms]![frmName]![txtValue]* where [txtValue] is a number which can
be contained anywhere within a string. For example:

Reference ID: Number 12345

The only consistent is the '12345' and this can be contained anywhere in the
string as it is free-write text. I'm assuming that the * would both preceed
and succeed the value passed from the form.

Can someone please assist with the correct syntax to enable this.

Thanks in advance.
 
Very close. Include the quotation marks & build the entire string, like this:

Like "*" & [forms]![frmName]![txtValue] & "*"

For txtValue of "abc" This will resolve to:

Like "*abc*"

when the query is run.
 
Ggrrr!!!

I knew I was close but just couldn't nail it.

Thanks Brian.

Brian said:
Very close. Include the quotation marks & build the entire string, like this:

Like "*" & [forms]![frmName]![txtValue] & "*"

For txtValue of "abc" This will resolve to:

Like "*abc*"

when the query is run.

Mark said:
Hi,

I'm looking to pass a value from a form to a query using something like the
following:

Like *[forms]![frmName]![txtValue]* where [txtValue] is a number which can
be contained anywhere within a string. For example:

Reference ID: Number 12345

The only consistent is the '12345' and this can be contained anywhere in the
string as it is free-write text. I'm assuming that the * would both preceed
and succeed the value passed from the form.

Can someone please assist with the correct syntax to enable this.

Thanks in advance.
 
Back
Top