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

Query based of a value in a combo box

The application I'm working on has three tables State, Customer, Orders. In
the first combo box the State is selected. Based on the State selected the
second combo box will be populated with the Customers in that state. Based
on the Customer selected a datagrid will be populated with the customer's
orders.

I setup the query for the secont combo box as follows:
Select CustName From tblCustomer
Where State = @cboState

When I run this no records are selected. Any suggestions on what I am
missing or forgetting? Thanks...

--
Tony
May 22 '06 #1
2 2084
Hi,

I would check that you are passing the right value to your query.
If your combobox is bound to a datatable the selected item will be a
datarowview not the string shown in the combobox.

Ken
-----------------

"Tony A." wrote:
The application I'm working on has three tables State, Customer, Orders. In
the first combo box the State is selected. Based on the State selected the
second combo box will be populated with the Customers in that state. Based
on the Customer selected a datagrid will be populated with the customer's
orders.

I setup the query for the secont combo box as follows:
Select CustName From tblCustomer
Where State = @cboState

When I run this no records are selected. Any suggestions on what I am
missing or forgetting? Thanks...

--
Tony

May 22 '06 #2
Ken,

The combo box is configured as follows:

Name: cmbCustName
DataSource: TblCustomerBindingSource1
DisplayMember: CustName
VauleMember: CustName
SelectedItem: TblCustomerBindingSource1 - CustName

I declared a variable - Dim varCustNmae as String

After the State combo box is changed I have teh following code:
varCustName = cboState.SelectedValue

--
Tony
"Ken Tucker [MVP]" wrote:
Hi,

I would check that you are passing the right value to your query.
If your combobox is bound to a datatable the selected item will be a
datarowview not the string shown in the combobox.

Ken
-----------------

"Tony A." wrote:
The application I'm working on has three tables State, Customer, Orders. In
the first combo box the State is selected. Based on the State selected the
second combo box will be populated with the Customers in that state. Based
on the Customer selected a datagrid will be populated with the customer's
orders.

I setup the query for the secont combo box as follows:
Select CustName From tblCustomer
Where State = @cboState

When I run this no records are selected. Any suggestions on what I am
missing or forgetting? Thanks...

--
Tony

May 22 '06 #3

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

Similar topics

1
by: Gx | last post by:
I have this form with the fields: * Product: (drop down combo box) with choices - X, Y * Amount: (currency ) * Balance (currency) I want to associate product X with the percentage...
2
by: neptune | last post by:
I have a query where each customer has an or . Sometimes both fields for a customer are populated, but if is null, then will be populated and vice versa. I have a form, , where I select a...
5
by: Daniel Tan | last post by:
Are there anyway to copy rows of records from one query to another query and then hide the records in source query ? Pls advise. Thanks. Regards, Daniel
5
by: Rated R1 | last post by:
I wrote this before in the NGs, so I am going to paste the responses that I got and see if someone can please help me. Email me and we can set something up as Id even be willing to pay for your...
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)...
3
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"...
7
by: billelev | last post by:
I have a query that selects data based on a particular date. This date is selected from a combo box on a form. The data from the query is then used to generate a report. This report can be...
1
by: commodityintelligence | last post by:
Greetings, I am merging a series of different tables into one query to export decision-making information. I have some architecture issues I need to ask for help on. I have no programming...
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...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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...

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.