473,382 Members | 1,225 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,382 software developers and data experts.

Combo Boxes, Queries and Forms Oh My!


I have a form with two combo boxes. The value chosen in the first
combo box (cbo1) is supposed to change the values that appear in the
second combo box (cbo2). This currently works great for the first
record entered by the user (continuous forms). However in the second
record, cbo2 shows the values influenced by cbo1 in the first record,
rather than the 2nd record (i.e. it doesn't update).

My problem may be that both combo boxes have their Row Source as
queries, and query2 (for cbo2) is not updating after cbo1 gets filled
in the first time. How do I tell cbo2 to use the value from cbo1
current record, rather than first record? Do I need to use "me"? Do I
need to use VBA rather than the query, or run the query in some type of
"event"? Please provide detail as I'm not a VBA whiz.

Here is the SQL from cbo1 query:
SELECT [EQUIP LIST].EQUIP_NAME, [EQUIP LIST].STATUS
FROM [EQUIP LIST]
WHERE ((([EQUIP LIST].OBSOLETE)=0))
ORDER BY [EQUIP LIST].EQUIP_NAME;

And cbo2 query:
SELECT [PM CAL PROCEDURES].[PM DESCRIPTION], [PM CAL
PROCEDURES].EQUIP_NAME
FROM [PM CAL PROCEDURES]
WHERE ((([PM CAL
PROCEDURES].EQUIP_NAME)=[Forms]![frmRecordMorePM].[cboEquipList]));

Thanks!
Liana
Bend, Oregon

Jan 26 '07 #1
2 1641
Your 2nd query is a parameter query that gets its data based on whatever
is selected in the 1st combobox. In order for the 2nd Combobox to
repopulate with the correct data after a selection is made from the 1st
combobox, You need to requery the form. You can do this in the Click
event of the 1st combobox

Private Sub 1stCombo_Click()
Me.Requery
End Sub

Additionally, for data entry purposes, you may have better results with
a single form rather than a continuous form (go to form Design view -
select the form property sheet and select Single Form in the Default
View property).

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Jan 26 '07 #2
You don't need to requery the whole form, only the 2nd combo control in the
after update event of the 1st

Me![2ndCombo].Requery

"Rich P" <rp*****@aol.comwrote in message
news:45*********************@news.qwest.net...
Your 2nd query is a parameter query that gets its data based on whatever
is selected in the 1st combobox. In order for the 2nd Combobox to
repopulate with the correct data after a selection is made from the 1st
combobox, You need to requery the form. You can do this in the Click
event of the 1st combobox

Private Sub 1stCombo_Click()
Me.Requery
End Sub

Additionally, for data entry purposes, you may have better results with
a single form rather than a continuous form (go to form Design view -
select the form property sheet and select Single Form in the Default
View property).

Rich

*** Sent via Developersdex http://www.developersdex.com ***

Jan 26 '07 #3

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

Similar topics

1
by: Robert Neville | last post by:
The solution to my dilemma seems straight-forward, yet my mind has not been forthcoming with a direct route. My Project form has a tab control with multiple sub-forms; these distinct sub-forms...
1
by: arthur-e | last post by:
How can you select records based on more than one combo box - I have a combobox that selects records based on name (I'm sure this has been asked a thousand times - web site answer/link could be...
4
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)...
0
by: Tom | last post by:
I have some very strange issues with combo boxes on a tab control. Here's the scenario: I have a Windows Forms form that has a tab control on it, with two (2) tabs. Tab 2 happens to have a number...
4
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
2
by: biganthony via AccessMonster.com | last post by:
Hi, I decided to install Office 2003 Service Pack 3 on my home computer to test (in full knowledge that there may be some issues with it). After installation, I have noticed that with a small...
2
by: ARC | last post by:
I'm testing a user's db that contains a very large number of records. I have an invoice screen, with an invoice select dropdown box that shows all invoices, and the customer's name, etc. With...
0
by: Dawnyy | last post by:
I have a form which is bound to a dataset. I am filling the forms dataset on Form_Load event. On my form I have combo boxes which I am setting by running a stored procedure to return a datatable,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.