This is driving me mad!
I have been trying for 3 days now to work out how to do this with no success.
I have tables for Customer, Bookings, Entertainment, Act, Agent, and several others.
I have created a form to view existing bookings with Customer details as mainform and Bookings and Entertainment as subforms and this works fine.
I am trying to create forms to allow the booking clerk to enter a new Booking and am looking to have a Cascading Combo box for Entertainment Type (eg. Disco, Magician, Harpist etc) which upon selecting, offers the relevant Act Names in a second Combo Box.
I have built cascading combo boxes before but all have been based upon a one to many relationship - I just can't get my head round what I need to do for a many to many relationship.
The following 3 tables show details of table
Entertainment
EntID (PK) - autonumber
Type - text
Act
ActID (PK) - autonumber
ActName - text
EntertainAct
EntID - number
ActID - number
I am using Access 2007
Can someone please help before I smash my head against the wall!!!
8 9273
The second ComboBox.RowSource should be join of tables [Act] and [EntertainAct]. This could be easily filtered by EntertainAct.EntID field.
Regards,
Fish
This is the CLASSIC business model. Any Customer can buy any Service/Product/Act and any Act can be supplied to any Customer.. When you can't get your head around something, usually you haven't really defined your goal.
First, try NorthWind, supplied with Access (all versions, I think) for ideas.
Then take it step by step, maybe with paper and pencil (am I showing my age here?)
Customer calls booking clerk. What needs to be done first? Maybe bring up customer form? Verify that they are prior customer, all bills paid, addresses/phone #s up to date?
Customer will want an Act? By Entertainment or by Name? By either? He will want to know if available for some date or date-range? What do you want to see now? Possible Acts are those "Not Booked" and those should be filtered. From the available acts, you can generate the possible Entertainments.
Apparently Acts can be listed by multiple Entertainments. If you know the Acts that meet the original filter criteria, probably dates, then you build the necessary comboboxes.
Comboboxes dependent on prior choices don't always cascade. At least not in the usual sense. This can allow for some creative solutions.
These are just my thoughts, to get you thinking straight, not to supply specific answers.
@20028431
Along FishVal's Trend of Thought in Post #3 only a little more unnecessarily complicated, which I always seem to do: - cboEntertainment
- Column Count = 2
- Column Widths = 0;1
- Bound Column = 1
- Row Source = "SELECT [Entertainment].[EntID], [Entertainment].[Type] FROM Entertainment; "
- cboArts
- Column Count = 3
- Column Widths = 0;0;1.5
- Bound Column = 1
- Row Source = None
- AfterUpdate() Event of cboEntertainment
- Private Sub cboEntertainment_AfterUpdate()
-
Dim strSQL As String
-
-
strSQL = "SELECT Entertainment.EntID, Act.ActID, Act.ActName FROM Act INNER JOIN " & _
-
"(Entertainment INNER JOIN EntertainAct ON Entertainment.EntID = EntertainAct.EntID) " & _
-
"ON Act.ActID = EntertainAct.ActID WHERE Entertainment.EntID= " & Me![cboEntertainment].Column(0)
-
-
Me![cboActs].RowSource = strSQL
-
Me![cboActs].SetFocus
-
Me![cboActs].Dropdown
-
End Sub
- We'll allow you to cheat and Download the Attachment
Many Thanks to you all - will follow your suggestions tomorrow and post back to let you know how I got on.
Once again many thanks
NeoPa 32,556
Expert Mod 16PB
Some excellent advice contained here.
I couldn't resist posting after reading ADezii's post. Priceless (in the nicest way of course) :D
To the OP - Welcome to Bytes!
Hi Guys
Just wanted to say a massive big thank your for all your responses but in particular to ADezii (I like unnecessary complication!!).
I did download the zip file to see your example and then worked through the steps you oulined only to find that my initail problem was with my AfterUpdate SQL INNER JOIN coding duh!!!!!
Once again many thanks for your time.
NeoPa 32,556
Expert Mod 16PB
A pleasure dealing with you. It's always nice when a member posts back with thanks and an update.
Don't worry about the problem being somewhere else all along. That is so common, and just looking deeper into things often helps.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: (Pete Cresswell) |
last post by:
Seems like when there's a 1:1 relationship, the order of referential integrity
enforcement depends on which way you drag the mouse pointer when drawing the
relationship line.
If you drag from...
|
by: cognoscento |
last post by:
I'm currently putting together a database for my work (not an expert by
any stretch, so muddling through as best as I can... you know the
story...) and I could use some advice and hand-holding
...
|
by: dBNovice |
last post by:
Hello All, I have a DB that have 6 tables - tblCreator, tblSummary,
tblPaper, tblProposition, tblContributor, tblPanel. The tables are
linked in the following way:
tblSummary is linked with...
|
by: Rabbit |
last post by:
Cascading Combo/List Boxes
This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
|
by: Kevin |
last post by:
I need some help figuring this one out. I'm sure I did something like it
awhile back
but I can seemed to find that database or remember how I did this. Any way,
the
database tables are...
|
by: kcdoell |
last post by:
I have three tables:
One for the Division location:
tblDivision
DivisionID = Autonumber
DivisionName = Text
One for the Working Region:
tblWrkRegion
|
by: kcdoell |
last post by:
Good Morning:
I have a form where I am trying to create cascading combo boxes. I have done this before but I am getting the following error that is throwing me off:
Procedure declaration...
|
by: kcdoell |
last post by:
I have 5 cascading combo boxes on a form. Below is a sample of my vb in the first combo box:
Private Sub CboDivision_AfterUpdate()
'When the Division is selected, the appropriate Segment...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
| |