If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Combo Box

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-26-11, 01:57
Roy Hopkins Roy Hopkins is offline
Registered User
 
Join Date: Jul 2011
Posts: 3
Red face Combo Box

I have a master form and sub form with the master and child set.
There is a customer database and a bookings database with a one to many relationship.
Both have "Customer Name" in the relationship.
If I create a combobox in the subform in the phone field and I want to be able to select only the relevant data related to "Customer name" on the master form?
At the moment the combobox shows all of the phone numbers for all of the customers :-(
I am new at this so be gentle
Reply With Quote
  #2 (permalink)  
Old 07-26-11, 06:44
kez1304 kez1304 is offline
Registered User
 
Join Date: Jun 2011
Location: Inside your mind
Posts: 267
Sounds to me that you need to specify the row source of the combo box to only show the results you want.

I can give you some SQL code if you can tell me the table names, field names and what exactly you want to be shown (by indicating it on your table diagrams a * for what you want to be shown, or something similar).

So for example:

Code:
Tbl_aTable1
aField name | aField name 2 | aField name 3*
------------+---------------+----------------
 some value |  some value   |  some value
Also, let me know exactly where the relationship is, and why it exists... I'm assuming you're user will input a piece of data, which is then looked up on another table, using the primary/foreign key.
Reply With Quote
  #3 (permalink)  
Old 07-26-11, 14:58
Roy Hopkins Roy Hopkins is offline
Registered User
 
Join Date: Jul 2011
Posts: 3
hello

Table name Customers
Field names
Customer Name | more fields but not phone.
--------------------------------------------
Table Name Bookings
Customer Name | Phone
--------------------------------------------

The subform is to take new bookings for a dispatch operator.
I have only shown the phone field at this time to keep things simple.
The subform correctly shows only data related to the customer name on the master form but if I put a combo box on the subform it shows all of the phone numbers in thd bookings database and not just the ones related to the current customer on the master form.
I have set up a one to many relations shipt from Customers Table to Bookings table as I thought it was required but I may be wrong.
I have other fields that I will be using in the bookings table but the basic principle I want is the same for those fields.

Thanks for your help in advance
Reply With Quote
  #4 (permalink)  
Old 07-28-11, 14:56
Roy Hopkins Roy Hopkins is offline
Registered User
 
Join Date: Jul 2011
Posts: 3
I forgot to mention the subform is based on a combo box selection for the "customer name" on the master form.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On