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

ComboBox - Controlling Fill

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 (frmSelectCompany).
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 1309
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 (frmSelectCompany).
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
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
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...
8
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...
6
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...
6
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...
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
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: 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...
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
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...

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.