473,796 Members | 2,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2099
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: TblCustomerBind ingSource1
DisplayMember: CustName
VauleMember: CustName
SelectedItem: TblCustomerBind ingSource1 - CustName

I declared a variable - Dim varCustNmae as String

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

--
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
7002
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 amount of 50 %, Y with 10
2
2926
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 value for from a combo box. In my query I set the criteria for to ... My query finds the proper values for . Now I also want to find the values if I select a value for in a separate combo box. In both controls, OnChange, I set the value of
5
2694
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
2149
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 time to get me to learn this procedure: MY ORIGINAL POST: I am trying to create a database for my small business. I have typed a bunch of information in a table in 5 columns (style, mm, karat, quantity, labor cost). We have different labor...
4
7194
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) how to use the selection "All" as criteria for a field in a query, which is used to generate data for a report.
3
3657
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" through "Phase 10" (there are 10 Phases I want to sort from) Once the phase has been selected a second combo box would populate.
7
7671
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 filtered using other features on the form where the date is set. I am able to modify the query using the date set on the form. SELECT AssetPrices.Symbol, Max(AssetPrices.Date) AS MaxOfDate FROM AssetPrices, PricingDate WHERE...
1
1873
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 training. I will explain my structure before asking my questions. I have data from a table (updated monthly by adding the most current month’s data) that is evaluated by certain arithmetic, given an adjective to describe it, and then being exported...
1
8067
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 a commandbutton on my form). The biggest problem I'm having is that I can't (don't know how) populate a combobox on static items such as "True, False, Any." The Any field, would be selected by the user to find all records where that fields is...
0
9529
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10457
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10231
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10176
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10013
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9054
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6792
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5443
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3733
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.