473,397 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

problem with form feeding query

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
4 1610
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jan Nordgreen | last post by:
I use php4 and winxp. This query works as expected: $result = mysql_query(" SELECT feventid, UNIX_TIMESTAMP(fdate) as fdate, ftitle, fpostedby, fdetails, factive, UNIX_TIMESTAMP(fpostdate) as...
1
by: martin | last post by:
I have this statement DoCmd.OpenReport "test", acViewPreview, , " = " & Me.MemberID to print only the current record. It will pop up a box to define MemberID every time it is run. What am I...
5
by: Ronald S. Cook | last post by:
I need ideas on how to best design a Windows form for my particular situation. On a cattle feeding yard there will be between about 300 and 600 pens. On my "Pen Feeding Sequence" form, I want...
1
by: rfr | last post by:
I have a need to use a single version of a Visitor Response Feedback Form on numerous HTML documents. Rather than have numerous versions of this, one on each HTML document, it makes more sense to...
0
by: SolomonShavitzMetsFan | last post by:
Is there a way to have a button above each of three columns of a subform to do a runtime sort of the respective columns below the buttons? The only way I can think of is to have three different...
8
JustJim
by: JustJim | last post by:
Imagine if you will, a beautifully designed and normalised database application. OK that's enough. On to my database application! I envisage a form with multiple combo-boxes feeding a query so...
1
by: jonKushner | last post by:
id like to create a script that runs through a form, and autogenerates every single permutation for every single value, as well as option. The task is because I am currently working on a webservice...
4
by: BigM | last post by:
Hi All, I've been playing around with this for ages and am just about stuck! I have set up small tests off array_diff, manually feeding entries into arrays and it works fine, but the below does...
2
by: DeanL | last post by:
Hi everyone, I have a subform in datasheet view that is used to display the contents of a single table. I have another subform with a query feeding it to give a count of how many particular...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.