473,396 Members | 2,036 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,396 software developers and data experts.

Combobox selection to query

Access 2003 (2000 file format) question:

When I run a form, it opens with only a combo box and a button to
execute a query based on the criteria tha is selected in the combobox.
Then I need Access to open a report using that query.

Can someone give me some pointers on how to do this, or please point me
in the direction I need to look for this answer?

Thanks,
Ray
Nov 13 '05 #1
3 5575
Ray Holtz wrote:
Access 2003 (2000 file format) question:

When I run a form, it opens with only a combo box and a button to
execute a query based on the criteria tha is selected in the combobox.
Then I need Access to open a report using that query.

Can someone give me some pointers on how to do this, or please point me
in the direction I need to look for this answer?


Perhaps the easiest way to do this is to first create the query you wish
to have as the recordsource for the report. Use some test criteria.
Set up your report to work as you require.

Next, create the form and the combo box.

Now, go back to the query and open it in design view. Where you have
the criteria beneath a field in the design view, replace it with:

[Forms]![frmName]![cboName]

And save it.

Next you can create a button on your form, and the command button wizard
is helpful here, to open the form.

Voila!
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #2
Hmm, I tried that just now, and after I select from the combobox, and
click the button to open the Report, it brings up a message box for the
query asking to enter a parameter value and says
"Forms!FrmWhichDept!CboWhichDept" and a text box for me to type in. I
am trying to skip this step where it asks the user to type the
department name. This is so the user doesn't have to remember the whole
department name and type it exactly as Access knows it. Rather they
just select it from a combo box.
Thanks, but any other suggestions... anyone?
Tim Marshall wrote:
Ray Holtz wrote:
Access 2003 (2000 file format) question:

When I run a form, it opens with only a combo box and a button to
execute a query based on the criteria tha is selected in the
combobox. Then I need Access to open a report using that query.

Can someone give me some pointers on how to do this, or please point
me in the direction I need to look for this answer?

Perhaps the easiest way to do this is to first create the query you wish
to have as the recordsource for the report. Use some test criteria. Set
up your report to work as you require.

Next, create the form and the combo box.

Now, go back to the query and open it in design view. Where you have
the criteria beneath a field in the design view, replace it with:

[Forms]![frmName]![cboName]

And save it.

Next you can create a button on your form, and the command button wizard
is helpful here, to open the form.

Voila!

Nov 13 '05 #3
Ok, I had a button calling a macro that first closed the form, then
opened the report, I have it opening the report then close the 1st form
and it works great!
Thanks Tim, you helped me A LOT!
Ray

Tim Marshall wrote:
Ray Holtz wrote:
Access 2003 (2000 file format) question:

When I run a form, it opens with only a combo box and a button to
execute a query based on the criteria tha is selected in the
combobox. Then I need Access to open a report using that query.

Can someone give me some pointers on how to do this, or please point
me in the direction I need to look for this answer?

Perhaps the easiest way to do this is to first create the query you wish
to have as the recordsource for the report. Use some test criteria. Set
up your report to work as you require.

Next, create the form and the combo box.

Now, go back to the query and open it in design view. Where you have
the criteria beneath a field in the design view, replace it with:

[Forms]![frmName]![cboName]

And save it.

Next you can create a button on your form, and the command button wizard
is helpful here, to open the form.

Voila!

Nov 13 '05 #4

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

Similar topics

3
by: Wayne Wengert | last post by:
I am trying to populate a combobox with a lisy of items. I want the 1st item to be "Make a Selection" and the following items will be names from a table in my DB (See code below). When I run the...
1
by: Steve | last post by:
I have a continuous form with several unbound comboboxes in the form header. The comboboxes are used to provide criteria for the SQL of the form. The code behind the form looks like: Public Sub...
5
by: Steve | last post by:
I have an unbound combobox in the form header of a continuous form. The selection in the combobox sets the where clause in a querydef which determines QryPFrmInventoryManagement. The following code...
7
by: Nicolae Fieraru | last post by:
Hi All, I am trying to change the rowsource of a combobox when I click on it. I played with many events, associated with the form and the combobox, but still haven't figured out what is the way...
0
by: zfeld | last post by:
I have a ComboBox with the Simple DropDownStyle. when I select an item in the combobox list the SelectedIndexChanged Event and the SelectionChangeCommited Event are fired. When I type something...
5
by: Eric A. Johnson | last post by:
Hi Everyone, I am at my wit's end here. I have a combobox (combyQueryTitle) that I need to use in order to select a query for my database project. Therefore, I am using the...
2
by: jen | last post by:
i have select query that returns multiple records and populates a combobox/pulldown. once a selection from the pulldown is selected, i need to reference two or three fileds from the previous...
1
by: The.Daryl.Lu | last post by:
Hi, two parts to my problem if someone can help address either one or both: 1. I want to SELECT everything in the table if it matches the criteria when the query button is pressed (this is just...
4
by: Mtek | last post by:
Hi, We have a combo box on our page, which gets populated via a MySQL Query in PHP. What we want to do is to print the values on the page in a table that correspond the to selection from the...
9
by: Greg (codepug | last post by:
I have a combobox with the RowSourceType set to Table/Query and the RowSource is an SQL query that references a separate lookup table that contains the data that can be selected in the combobox....
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
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.