By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,509 Members | 2,185 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,509 IT Pros & Developers. It's quick & easy.

problem with form feeding query

P: n/a
Hi
I have a form to feed a query which then runs a report. I want to be
able to produce a report based on the first letter e.g. P. I can type
in Like "P*" in criteria and the query works fine. I have a form with
a combo box to make running the report easier. the table the combo
feeds from has a record for each "P*", etc. I have set up [Forms]!
[frmProjectName]![cboProject], yet when I select "P" for instance it
comes up blank. I have tried Like "P*" and even = before it. Any
suggestions please.

Sep 16 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
i'm not entirely clear on what you're doing, but i think you're saying that
you want to take a value entered in a form control, and use that value as
criteria in a query, correct?

if the value in the form control cboProject is "P", for instance, then try
the following criteria in the query, as

Like [Forms]![frmProjectName]![cboProject] & "*"

hth
"prufrock" <am*******@gmail.comwrote in message
news:11*********************@r29g2000hsg.googlegro ups.com...
Hi
I have a form to feed a query which then runs a report. I want to be
able to produce a report based on the first letter e.g. P. I can type
in Like "P*" in criteria and the query works fine. I have a form with
a combo box to make running the report easier. the table the combo
feeds from has a record for each "P*", etc. I have set up [Forms]!
[frmProjectName]![cboProject], yet when I select "P" for instance it
comes up blank. I have tried Like "P*" and even = before it. Any
suggestions please.

Sep 17 '07 #2

P: n/a
On Sep 16, 6:42 pm, prufrock <amara1...@gmail.comwrote:
Hi
I have a form to feed a query which then runs a report. I want to be
able to produce a report based on the first letter e.g. P. I can type
in Like "P*" in criteria and the query works fine. I have a form with
a combo box to make running the report easier. the table the combo
feeds from has a record for each "P*", etc. I have set up [Forms]!
[frmProjectName]![cboProject], yet when I select "P" for instance it
comes up blank. I have tried Like "P*" and even = before it. Any
suggestions please.
I have noticed that Like doesn't work as expected in some versions of
Access. What version are you using?

Sep 17 '07 #3

P: n/a
On Sep 18, 1:55 am, OldPro <rrossk...@sbcglobal.netwrote:
On Sep 16, 6:42 pm, prufrock <amara1...@gmail.comwrote:
Hi
I have a form to feed a query which then runs a report. I want to be
able to produce a report based on the first letter e.g. P. I can type
in Like "P*" in criteria and the query works fine. I have a form with
a combo box to make running the report easier. the table the combo
feeds from has a record for each "P*", etc. I have set up [Forms]!
[frmProjectName]![cboProject], yet when I select "P" for instance it
comes up blank. I have tried Like "P*" and even = before it. Any
suggestions please.

I have noticed that Like doesn't work as expected in some versions of
Access. What version are you using?
I am using Access 2003. It works fine when feeding straight into
criteria filled in the query but not at all when the letter is from
the form. Have tried Like [Forms]![FrmProjectName]![cboProject] & "*"
in the query but not having any effect, except to list all entries in
the report.

Sep 18 '07 #4

P: n/a
On Sep 18, 2:51 am, prufrock <amara1...@gmail.comwrote:
On Sep 18, 1:55 am, OldPro <rrossk...@sbcglobal.netwrote:
On Sep 16, 6:42 pm, prufrock <amara1...@gmail.comwrote:
Hi
I have a form to feed a query which then runs a report. I want to be
able to produce a report based on the first letter e.g. P. I can type
in Like "P*" in criteria and the query works fine. I have a form with
a combo box to make running the report easier. the table the combo
feeds from has a record for each "P*", etc. I have set up [Forms]!
[frmProjectName]![cboProject], yet when I select "P" for instance it
comes up blank. I have tried Like "P*" and even = before it. Any
suggestions please.
I have noticed that Like doesn't work as expected in some versions of
Access. What version are you using?

I am using Access 2003. It works fine when feeding straight into
criteria filled in the query but not at all when the letter is from
the form. Have tried Like [Forms]![FrmProjectName]![cboProject] & "*"
in the query but not having any effect, except to list all entries in
the report.
This may be a quotes issue. Does your query string look something
like this?
sSQL="SELECT fld1 FROM tbl1 WHERE fld1 LIKE ' " & cboProject & " * ' "
Note: I put spaces between the single quotes, asterisk, and the double
quotes for clarity; you would have to take them out.

Sep 18 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.