473,503 Members | 2,135 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

combo box in query

How can i include a combo box in the criteria field in a parameter query

Nov 12 '05 #1
5 13818
The syntax to refer to the control on a form is:

Forms!frmFormName!ctlContolName

on a subform:
Forms!frmParentFormName!ctlSubformControlName.Form !ctlControlName

The ctlSubformControlName is the name of the control on the main form that holds the
subform, not the name of the subform itself.

--
Wayne Morgan
Microsoft Access MVP
"LouD" <du******@yahoo.com> wrote in message
news:3Z*********************@news-server.bigpond.net.au...
How can i include a combo box in the criteria field in a parameter query

Nov 12 '05 #2
where do I put this syntax, at the mom what i have in the criteria field
is [enter name here]

Wayne Morgan wrote:
The syntax to refer to the control on a form is:

Forms!frmFormName!ctlContolName

on a subform:
Forms!frmParentFormName!ctlSubformControlName.Form !ctlControlName

The ctlSubformControlName is the name of the control on the main form that holds the
subform, not the name of the subform itself.


Nov 12 '05 #3
Place it in the criteria field instead of what you have. Access will probably put brackets
around each part when you are done. The form must be open (visible or hidden is ok) for
this to work.

Remember the value of a combo box is the value of the Bound Column for the row that is
selected. If the value you are looking for is in a different column, you will need to
specify the column.

--
Wayne Morgan
Microsoft Access MVP
"LouD" <du******@yahoo.com> wrote in message
news:sg*******************@news-server.bigpond.net.au...
where do I put this syntax, at the mom what i have in the criteria field
is [enter name here]

Wayne Morgan wrote:
The syntax to refer to the control on a form is:

Forms!frmFormName!ctlContolName

on a subform:
Forms!frmParentFormName!ctlSubformControlName.Form !ctlControlName

The ctlSubformControlName is the name of the control on the main form that holds the
subform, not the name of the subform itself.

Nov 12 '05 #4
Wayne

I tried suggesting what you said but it stll comes up as a msg text box
not a msg combo box heres is the sql the was genrated when i used to
wizard to set up the query
SELECT tblDetail.Det_ID, tblCategory.Cat_Code, tblName.Plant_Name,
tblName.Generic_Name, tblContainer.Cont_Size, tblDetail.Cost,
tblDetail.Price, tblDetail.Quantity, tblLocation.Loc_Code
FROM tblName INNER JOIN (tblLocation INNER JOIN (tblContainer INNER JOIN
(tblCategory INNER JOIN tblDetail ON tblCategory.Cat_ID =
tblDetail.Cat_ID) ON tblContainer.Cont_ID = tblDetail.Cont_ID) ON
tblLocation.Loc_ID = tblDetail.Loc_ID) ON tblName.Plant_ID =
tblDetail.Plant_ID
GROUP BY tblDetail.Det_ID, tblCategory.Cat_Code, tblName.Plant_Name,
tblName.Generic_Name, tblContainer.Cont_Size, tblDetail.Cost,
tblDetail.Price, tblDetail.Quantity, tblLocation.Loc_Code
HAVING (((tblName.Plant_Name) Like "*" & [Enter the plant name or frist
characters of the name:] & "*"));

Yr assitance appreciated

Wayne Morgan wrote:
Place it in the criteria field instead of what you have. Access will probably put brackets
around each part when you are done. The form must be open (visible or hidden is ok) for
this to work.

Remember the value of a combo box is the value of the Bound Column for the row that is
selected. If the value you are looking for is in a different column, you will need to
specify the column.


Nov 12 '05 #5
You're right, doing it this way won't bring up a combo box. To bring up a combo box you
will need to create your own form with a combo box on it then have the query's criteria
refer to that combo box.

What are you using this query for? If it is for another form or a report, you could pop-up
the form with the combo box in the OnOpen event of this other form or report using the
acDialog window mode argument. This will pause the code until you hide or close (you'll
have to hide it for the query to see it because it has to be open) the pop-up form and
will allow the value in the combo box to be set before the query is looking for it.
HAVING (((tblName.Plant_Name) Like "*" & [Forms]![frmFormName]![ctlContolName] & "*"));
--
Wayne Morgan
Microsoft Access MVP
"LouD" <du******@yahoo.com> wrote in message
news:83*********************@news-server.bigpond.net.au... Wayne

I tried suggesting what you said but it stll comes up as a msg text box
not a msg combo box heres is the sql the was genrated when i used to
wizard to set up the query
SELECT tblDetail.Det_ID, tblCategory.Cat_Code, tblName.Plant_Name,
tblName.Generic_Name, tblContainer.Cont_Size, tblDetail.Cost,
tblDetail.Price, tblDetail.Quantity, tblLocation.Loc_Code
FROM tblName INNER JOIN (tblLocation INNER JOIN (tblContainer INNER JOIN
(tblCategory INNER JOIN tblDetail ON tblCategory.Cat_ID =
tblDetail.Cat_ID) ON tblContainer.Cont_ID = tblDetail.Cont_ID) ON
tblLocation.Loc_ID = tblDetail.Loc_ID) ON tblName.Plant_ID =
tblDetail.Plant_ID
GROUP BY tblDetail.Det_ID, tblCategory.Cat_Code, tblName.Plant_Name,
tblName.Generic_Name, tblContainer.Cont_Size, tblDetail.Cost,
tblDetail.Price, tblDetail.Quantity, tblLocation.Loc_Code
HAVING (((tblName.Plant_Name) Like "*" & [Enter the plant name or frist
characters of the name:] & "*"));

Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2368
by: Dalan | last post by:
I have been searching the archives in an effort to discover how to derive a dual use of a single combo box - so far no go. I found the piece below which pretty much represents the usage. To...
0
2364
by: Andrew | last post by:
Hello, I am trying to create a chart whose underlying query is linked to 2 combo boxes on the same form. I want to pass the values from the combo boxes into the chart query to allow the chart...
4
7135
by: meganrobertson22 | last post by:
Hi Everyone- I have a question about how to add and then use the "All" selection in a combo box. I am trying to figure out how to: (1) add "All" as a selection to a combo box and then (2)...
3
3622
by: hmiller | last post by:
Hey everyone, I am having a hell of a time trying to set this menu system up. Here's what I'm trying to do. Combo Box One; is populated by names under properties "row source" "Phase 1"...
2
1851
by: MLH | last post by:
I invoked the combo-box wizard today, telling it to use a 4-table union query as a row-source for the combo-box it was assisting me in building. The error I got was without number and stated,...
2
3044
by: visionstate | last post by:
Hi there, I am working on a form that uses 3 text boxes and 3 combo boxes. When any data is entered into any of these, I click a command button and this requeries a sub query in the form and...
6
12453
by: fieldja | last post by:
I have a form called OwnerForm. It contains a combo box called Owner. The combo box looks up names from a table called OwnerName. It contains fields called OwnerID and Owner. I also have a main...
1
3087
by: lawton | last post by:
Source: this is an access 2003 question My knowledge level: reading books, internet, and trial & error; no formal training I'm trying to get a running sum of what's filtered in a subform which is...
3
3288
by: emily.a.day | last post by:
I have a book database, and I have set up a query to search by subject. As it is now, the searcher has to know the subject and type it into the query. I wonder if there is a way to have a combo...
0
2896
by: Del | last post by:
Hello and thanks for any and all assistance! I have a database that is used by several users on several different machines. The backend database is housed on a file server. Each user has a...
0
7093
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
7287
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,...
1
7011
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
7468
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
5596
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,...
0
4689
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3170
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.