Like functioin

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

Guest

I am trying to create a macro that contains the following where condition.
What I am looking to do is limit the number of records retruned in a form. A
field contains the folowind type of numbers 201.02.02. The field is formated
as text. I need to limit it by the first three numbers. I have tried the
following.

[Forms]![Frm_Standard Progress]![Standard Number] Like "201*"

The above returns no records at all. Any advice? Thank you
 
Can you use the Where argument of the OpenForm action to do what you seek?
That would limit the number of records returned to the form directly.
 
Jason said:
I am trying to create a macro that contains the following where condition.
What I am looking to do is limit the number of records retruned in a form. A
field contains the folowind type of numbers 201.02.02. The field is formated
as text. I need to limit it by the first three numbers. I have tried the
following.

[Forms]![Frm_Standard Progress]![Standard Number] Like "201*"

The above returns no records at all. Any advice? Thank you

It sounds like you're assuming that data is stored in a Form and that you
can search a Form for it.

You have it backwards: data is stored in Tables. Only in tables! A Form is
just a window, a tool to view data in a Table.

Either base your Form on a Query using a criterion

LIKE "201*"

on the field; or set the Form's Filter property to

[Standard Number] LIKE "201*"

and set its Filteron property to True.
 
Try changing the " characters to ' characters in your expression.

[Forms]![Frm_Standard Progress]![Standard Number] Like '201*'

--

Ken Snell
<MS ACCESS MVP>

Jason said:
That is my goal, I am just not sure how to make that happen, I tried
putting
the above statement in the where fuction. It just does not return any
records.

Ken Snell (MVP) said:
Can you use the Where argument of the OpenForm action to do what you
seek?
That would limit the number of records returned to the form directly.

--

Ken Snell
<MS ACCESS MVP>

Jason said:
I am trying to create a macro that contains the following where
condition.
What I am looking to do is limit the number of records retruned in a
form.
A
field contains the folowind type of numbers 201.02.02. The field is
formated
as text. I need to limit it by the first three numbers. I have tried
the
following.

[Forms]![Frm_Standard Progress]![Standard Number] Like "201*"

The above returns no records at all. Any advice? Thank you
 
Ignore the reply I just posted.... John's point about the criterion
expression was the right suggestion!

--

Ken Snell
<MS ACCESS MVP>

Jason said:
That is my goal, I am just not sure how to make that happen, I tried
putting
the above statement in the where fuction. It just does not return any
records.

Ken Snell (MVP) said:
Can you use the Where argument of the OpenForm action to do what you
seek?
That would limit the number of records returned to the form directly.

--

Ken Snell
<MS ACCESS MVP>

Jason said:
I am trying to create a macro that contains the following where
condition.
What I am looking to do is limit the number of records retruned in a
form.
A
field contains the folowind type of numbers 201.02.02. The field is
formated
as text. I need to limit it by the first three numbers. I have tried
the
following.

[Forms]![Frm_Standard Progress]![Standard Number] Like "201*"

The above returns no records at all. Any advice? Thank you
 

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

Back
Top