473,395 Members | 1,783 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.

Simple Form/Table Question

My first post from a newbie.

I have created a form where I need to pull data out of a table multiple times.
The table is "Customer". The form has various other fields which work fine.
The tables are already fully populated.

My form looks like this:

Date:
Company Name:
Customer 1:
Customer 2:
Customer 3:

All the choices are drop downs. My issue is that when I select John Doe in Customer 1, it populates John Doe in Customer 2 and 3. I want to be able to select 3 different names from the same Customer table.

Please advise,
Thanks in advance.
Mar 12 '08 #1
8 1330
Scott Price
1,384 Expert 1GB
A combo box has both a control source and a record source. The general way to do this is to leave the control source blank, and set the record source to a sql statement or query. SELECT [ColumnName] FROM [TableName], should do the trick.

Being that the combo box is now 'unbound', meaning that it's control source is blank, you'll need to write a spot of code to tell the database what to do with the values that you choose in each combo box.

Regards,
Scott
Mar 12 '08 #2
Megalog
378 Expert 256MB
From what you've said, I believe that all 3 of your Customer fields are tied to the same control source, seeing how all 3 update upon selecting just one.

Make sure they have unique control sources, or if this is an unbound form, then no control sources at all.
Mar 12 '08 #3
Your explainations help. It worked. Thanks.

Can you elaborate on the additional code I need to write and where?
I looked around to see if anyone else posted the same type of question and I couldn't see anything.

Could you point me to the right direction?

Thanks
Mar 13 '08 #4
Scott Price
1,384 Expert 1GB
The code really depends on what you want to do with these three combo boxes.

Do you want to use them as a filter for a query? A description of what you are trying to accomplish with them would help us help you :-)

Regards,
Scott
Mar 13 '08 #5
Yes, sorry about that. I would like the data which comes off the form to be able to go into a query that I built off the form.

The query right now grabs all the entries from the drop down form, but now I would like to add this new field into my existing query.

Let me know if you need any more info.
Mar 14 '08 #6
Scott Price
1,384 Expert 1GB
Please post the SQL of your query, and the names of your combo boxes.

Just to clarify this: When you choose three names in your three combo boxes (one each) you want your query to return just the records associated with those three names, right?

If you choose only two names, you want only two records returned, etc?

Regards,
Scott
Mar 14 '08 #7
I've kinda modified my query/form since my initial post but the same problem remains.

My form now allows for my to select names in Customer and Customer2 and Customer3 from the same table. I now want them to go into my Query.

To clarify what I need: I want my Query to show all 3 Customers, but it now only shows Customer. All I really need is to be able to show Customer2 and Customer3 in the query.


Thanks



SELECT [Client List].Title, Date.Date, Address.Address, [Return Customer].[Return Customer], Customer.Customer

FROM Customer INNER JOIN ([Return Customer] INNER JOIN (Address INNER JOIN ([Client List] INNER JOIN [Date] ON [Client List].Date = Date.ID) ON Address.ID = [Client List].Address) ON [Return Customer].ID = [Client List].[Return Customer]) ON Customer.ID = [Client List].Customer

ORDER BY [Client List].Title;
Mar 14 '08 #8
Scott Price
1,384 Expert 1GB
You will need to add the WHERE clause to include the entries of the three combo boxes. The SQL will end up looking more like this:

Expand|Select|Wrap|Line Numbers
  1. WHERE Customer.Customer = Forms![FormName]![ComboBoxName] OR Customer.Customer = Forms![FormName]![ComboBoxName2] OR Customer.Customer = Forms![FormName]![ComboBoxName3]
  2.  
This will end up before the ORDER BY clause.

Regards,
Scott

PS to use the CODE tags, simply select your sql statement, then click on the # icon on the top of the reply window. Thanks!
Mar 15 '08 #9

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

Similar topics

4
by: Dariusz | last post by:
I am a beginner in PHP and MySQL, and am working through a book and various online tutorials on PHP and MySQL and now stuck - installed everything on "localhost" and it all works fine. My question...
7
by: J. Hall | last post by:
Hi dudes, Got a simple webpage, with three numeric text input boxes, the idea being that the user is asked to insert percentages of their business around the world... UK, Europe, Other ...
13
by: LRW | last post by:
Having a problem getting a onSubmit function to work, to where it popsup a confirmation depending on which radiobutton is selected. Here's what I have: function checkdel() { if...
2
by: not | last post by:
Hello All, I am trying to develop a relatively simple self-quiz form in javascript, but I'm having no luck getting it to work. What I am looking for is a script that allow the user to select...
2
by: text news | last post by:
Sorry, I am trying to learn.... I have two tables. Table one is "Name" and table two is "Books" The tables are linked by a primary key called "ID". In the first table is a field called...
4
by: Danny | last post by:
Ok I am trying to create this 2 Tables 1 form The 1st table has Reference Number, Username, Telephone The 2nd table has Reference Number, 2nd Telephone Well what I would like to do is...
1
by: Greg Acuna | last post by:
I've been using Access 2002 for several months and thought I was getting proficient, but at the moment I'm feeling like a moron because I can't get it to do something that seems simple. I have a...
6
by: someguy | last post by:
Hi, I'm trying to accomplish the following on a form on which i have removed navigational buttons (I apologize in advance if this is too many questions); The two easy ones are.... 1) When...
24
by: firstcustomer | last post by:
Hi, Firstly, I know NOTHING about Javascript I'm afraid, so I'm hoping that someone will be able to point me to a ready-made solution to my problem! A friend of mine (honest!) is wanting to...
6
by: Jim M | last post by:
I've been distributing a fairly mature, very specific MS Access application to end users in small offices of colleges for several years now. This is a part-time venture and low volume operation-...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.