Parameter Query - Pass value from Form Field with Like

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.
 
G

Guest

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.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top