473,769 Members | 5,742 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ComboBox - Controlling Fill

2 New Member
Hi there,

I have just started using Access 2003 in the last couple of months and have a couple of problems i would like some help with please for a project i am working on.

PROBLEM 1.
I have a ComboBox (cboSelect) on my form (frmSelectCompa ny).
I am populating this combobox with [CompanyName] data from my OrderTable.
The problem is if a company has made more than 1 order that company shows up more than once in my combobox, but i only want 1 entry for any CompanyName in the combobox.
Is there any way of limiting the combobox (something like, only putting CompanyName in combobox if it does not already exist)?

PROBLEM 2.
I would like to grab data from a table, but only if a certain field matches a set value.
I was thinking i need to run a loop looking for the value in the table, then if found get that info, but i have no idea how to do this.

Basically i need the calculation below to run in a loop checking a table to see if [SELL PRICE]=[Price]

=IIf([SELL PRICE]=[Price],IIf([SALE QTY] Mod [Quantity]="0",[SALE QTY]/[Quantity],([SALE QTY]\[Quantity])+(([SALE QTY] Mod [Quantity])*[SELL PRICE])),[SELL PRICE]*[SALE QTY])


Any help with either of these problems would be greatly appreciated.

Thanks
Graham
Sep 12 '07 #1
2 1328
Cara Murphy
5 New Member
Hi there,

I have just started using Access 2003 in the last couple of months and have a couple of problems i would like some help with please for a project i am working on.

PROBLEM 1.
I have a ComboBox (cboSelect) on my form (frmSelectCompa ny).
I am populating this combobox with [CompanyName] data from my OrderTable.
The problem is if a company has made more than 1 order that company shows up more than once in my combobox, but i only want 1 entry for any CompanyName in the combobox.
Is there any way of limiting the combobox (something like, only putting CompanyName in combobox if it does not already exist)?

PROBLEM 2.
I would like to grab data from a table, but only if a certain field matches a set value.
I was thinking i need to run a loop looking for the value in the table, then if found get that info, but i have no idea how to do this.

Basically i need the calculation below to run in a loop checking a table to see if [SELL PRICE]=[Price]

=IIf([SELL PRICE]=[Price],IIf([SALE QTY] Mod [Quantity]="0",[SALE QTY]/[Quantity],([SALE QTY]\[Quantity])+(([SALE QTY] Mod [Quantity])*[SELL PRICE])),[SELL PRICE]*[SALE QTY])


Any help with either of these problems would be greatly appreciated.

Thanks
Graham
Hi There,

Not sure on Problem 2, but Problem 1 can be solved by using:

SELECT DISTINCT [CompanyName] FROM [OrderTable].[CompanyName] ORDER BY [CompanyName]

(Use ORDER BY if you want the List to be ordered alphabetically)

Hope this helps!

Cheers
Sep 12 '07 #2
graywolf
2 New Member
Hi There,

Not sure on Problem 2, but Problem 1 can be solved by using:

SELECT DISTINCT [CompanyName] FROM [OrderTable].[CompanyName] ORDER BY [CompanyName]

(Use ORDER BY if you want the List to be ordered alphabetically)

Hope this helps!

Cheers
Thanks for the fast response.
That worked great ....thank you very much.
Sep 12 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
4620
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box bound to a table as a lookup, drawing values from another table to populate the available selections. This all worked fine in VB6. I have distilled the problem down to a simple form drawing data from the Northwind database for a representative...
8
2185
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got answered... In 1.1 we always did our own myDataAdapter.fills and we liked that control for lots of good reasons. Now the new DataSource (or is it a TableAdapter:Dataset) automatically fills the Gridview. How can we control that fill? In a...
6
2883
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox and the coresponding 'Id' from the lookup table is to be inserted into the field of the new record. I have two simple tables. "tblPerson" is the data table. The lookup
6
2326
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox and the coresponding 'Id' from the lookup table is to be inserted into the field of the new record. I have two simple tables. "tblPerson" is the data table. The lookup
0
9423
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
10210
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...
1
9990
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
8869
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...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5298
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...
0
5446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3956
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 we have to send another system
3
2814
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.