Limit records on report based on field length

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

Guest

How do I limit the report to only those the records that have a certain
number of characters in a text field.

I have a text field that has anywhere from two to five characters. I only
want the report to show those that have five characters.

I think I need to create a calculated field on the report using the script
LEN = 5, but don't know how to do this.
 
Patty Stoddard said:
How do I limit the report to only those the records that have a certain
number of characters in a text field.

I have a text field that has anywhere from two to five characters. I only
want the report to show those that have five characters.

I think I need to create a calculated field on the report using the script
LEN = 5, but don't know how to do this.

Use the expression...

=Len(TextFieldName)

If you added that as a calculated field in the query the report was bound to
then you could include the criteria =5 on that same field.
 
I stated my question wrong. The query does not have a calculated field. I
think I want to use a "control" on my report. In the design view of the
report, what do I do? For example, should I click on the field I want to do
the control on. If so, what then?

Thanks Rick.
 
Patty Stoddard said:
I stated my question wrong. The query does not have a calculated field. I
think I want to use a "control" on my report. In the design view of the
report, what do I do? For example, should I click on the field I want to do
the control on. If so, what then?

Having a calculated control on the report is not necessary.

You need to either ADD a calculated field to the query or else apply a filter
when opening the report by using the WHERE argument of the OpenReport method.

DoCmd.OpenReport "ReportName", acViewPreview,,"Len(FieldName)=5"
 

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