I know how to get a combo box to refer to another combo box, but if I want to add a third which refers to the data in both of the previous two, it's not working.
Any ideas?
24 1969
Thanks for your unhelp, I have read the posting guidelines thank you very much. This site is not user friendly at all and you offer no help to people who are just starting out in Access.
It is quite simple. I want to select the ship in the first box, the sailing date (only those for that ship) in the second, and the excursions on that date with that ship in the third.
Thanks for your unhelp, I have read the posting guidelines thank you very much. This site is not user friendly at all and you offer no help to people who are just starting out in Access.
It is quite simple. I want to select the ship in the first box, the sailing date (only those for that ship) in the second, and the excursions on that date with that ship in the third.
allystone99
That is not most peoples experience of this site.
However, as we have tried to explain you haven't given us enough information to help you out.
We just don't understand your question, or what you want.
We are in fact trying to be very helpful by asking you for specific information that we know will help us to understand your problem instead of just ignoring you which most sites would have done.
I don't understand why this is such a problem for you.
NeoPa 32,556
Expert Mod 16PB
Is the problem that English is not your first language?
I find that comment offensive. The problem is that I am a beginner to Access. If you can't tell me what you need to know than how am I supposed to give you the info you need?
NeoPa 32,556
Expert Mod 16PB
As a moderator on this site I cannot respond as I'd like to to your response.
Suffice to say, your demand for further assistance will go unanswered from me personally.
Bye.
I really don't know what your problem is with my question. It is very simple.
I have a combo box. Yes? It has some information in it.
I have a second combo box. The information that appears in this list is dependant on what is selected in the first combo box. Do you follow so far?
Now I want to add a third combo box. The information in this one will be dependant on what is selected in the first two.
Please can you tell me how to do this.
Am I speaking Dutch or something? Why is this so hard for you to grasp?
As you admitted in previous posts you are a beginner in Access and I am trying to make allowances for that fact. However, your rude tone is not helping you.
As experts we are aware of the fact that there are numerous answers to your question depending on various factors. I am giving the following as just a small example of them:
Are your combo boxes based on queries/tables or value lists?
How and from where are you obtaining the values in your combo boxes?
What criteria are the dependencies based on?
Is your bound column an integer or a string?
Are your combo boxes bound or unbound to a field?
There are many more issues that can affect the answer to your 'simple' question. We were trying to be helpful and asked you to provide information that would have helped us to figure out the answers to these questions.
The experts on this site volunteer their time free of charge to help out others with the knowledge and experience they have gained over the years.
I'm afraid with your attitude they are going to be very unwilling now to help you out.
If you had just responded civilly to the first couple of posts realising that there must be a reason that these questions were being asked you would probably have the answer to your question by now.
Forum Moderator
Banfa 9,065
Expert Mod 8TB
I really don't know what your problem is with my question.
The problem is that you are not providing any detail.
You have described your problem in English but you have not posted any of your existing code or any of your attempts so far to get the behaviour you require.
I have no doubt that the Experts in this forum can help you if you provide the information needed but you are doomed to get no-where if you provide no further detail.
Think on this, if you went to the garage because there was a problem with your cars headlights and asked them to tell you what the problem was without letting them see the car what do you think they would do?
Their most likely response would be they can't tell without seeing the car and please stop wasting their time.
Programming works the same way, in the majority of cases it is impossible to diagnose a problem without seeing the code in question.
If you really want help I suggest that you put what has happened in this thread so far behind you and post as much detail including code and SQL statements as you have about your problem.
Do not post only what you think is relevent, as you have already stated you are a novice and have got stuck on this problem. By definition this means you do not know what is relevent, Post everything.
Thank you very much for actually taking the time to explain to me what you need to know from me. I do appreciate your help and while I don't believe in being rude, it was only in response to what was posted to me.
Are your combo boxes based on queries/tables or value lists? They are based on a query
How and from where are you obtaining the values in your combo boxes? I don't understand this, is this the same as the question above?
What criteria are the dependencies based on?
Is your bound column an integer or a string?
Are your combo boxes bound or unbound to a field?
I'm sorry but I don't understand most of these questions. I will try to be as clear as I can but I don't know anything about code or SQL.
I am trying to make a form where you select various criteria and it runs a report based on your criteria.
The report will show revenue and profit.
The criteria is Ship, Sailing Date, and Excursion Name.
I am stuck on getting the lists that appear in the combo boxes to only show data which is appropriate to what is selected in the previous combo box(es).
I have tried to do a print screen but my pc at work doesn't have Paint so I can't show you.
You have described your problem in English but you have not posted any of your existing code or any of your attempts so far to get the behaviour you require.
I haven't written any code and I don't know where to look to find what you're looking for. :(
I only started using Access a few months ago and in that time I have taught myself how to write queries, make reports and even very simple macros, but making forms is like learning a new language.
The help in Access is crap IMO, I can't get it to tell me anything that I need.
I have been trying for 3 days now to figure this out and I have tried very hard, the trouble is that no-one at work is any good at Access either, we are not programmers.
I only started using Access a few months ago and in that time I have taught myself how to write queries, make reports and even very simple macros, but making forms is like learning a new language.
The help in Access is crap IMO, I can't get it to tell me anything that I need.
I have been trying for 3 days now to figure this out and I have tried very hard, the trouble is that no-one at work is any good at Access either, we are not programmers.
allystone99,
We'll take it one step at a time and we'll get you to what you want to do.
Firstly, open the form in design view. Now right click on the first combo box and open the properties. Under the data tab. Copy and post whatever is in the following properties.
Row Source Type
Row Source
Bound Column
Do the same for the Second combo box.
Now tell me if I have the logic correct for the third combo box.
(sorry if you get two versions of this post as I missed a previous post by you and am changing the following accordingly.)
Ship, Sailing Date, and Excursion Name
You have a list of Ships in the first combo box. When you select a Ship you want to see a list of Sailing Dates in the second combo box and when you select a Sailing Date you want to see a list of Excursion Names in the third combo box.
We'll get to the report when we figure this out first.
If there is any other information you feel might be helpful please include it. P.S. I have to go out in half an hour for a few hours (6 or 7), but I will return to this as soon as I get back. In the meantime, if it's urgent I will ask someone else to step in please let me know straight away.
Thank you very much you are really helping.
The first box has this:
Row Source Type: Table/Query
Row Source: Select [Ship] From [Ships];
Bound Column: 1
The second:
Row Source Type: Table/Query
Row Source: Sailing dates
Bound Column: 1
The third:
Row Source Type: Table/Query
Row Source: SELECT [Wecs with calculations].[Excursion Name], [Wecs with calculations].[Excursion Number], [Wecs with calculations].Ship, [Wecs with calculations].Date, [Cruise Names].[Cruise Name] FROM [Cruise Names] INNER JOIN [Wecs with calculations] ON ([Cruise Names].[First Sailing] = [Wecs with calculations].Date) AND ([Cruise Names].Ship = [Wecs with calculations].Ship) AND ([Cruise Names].Cruise = [Wecs with calculations].[Cruise Number]) GROUP BY [Wecs with calculations].[Excursion Name], [Wecs with calculations].[Excursion Number], [Wecs with calculations].Ship, [Wecs with calculations].Date, [Cruise Names].[Cruise Name] HAVING ((([Wecs with calculations].Ship) Like IIf([Forms]![Report Menu]![ship] Is Not Null,[Forms]![Report Menu]![ship],"*")) AND (([Wecs with calculations].Date) Like IIf([Forms]![Report Menu]![Sailing date] Is Not Null,[Forms]![Report Menu]![Sailing date],"*"))) ORDER BY [Wecs with calculations].Ship, [Wecs with calculations].Date;
Bound Column: 1
Should they all be running from the same source or doesn't it matter?
Change the row source for the third combobox to this: -
-
SELECT [Wecs with calculations].[Excursion Name], [Wecs with calculations].[Excursion Number],
-
[Cruise Names].[Cruise Name]
-
FROM [Cruise Names] INNER JOIN [Wecs with calculations]
-
ON ([Cruise Names].[First Sailing] = [Wecs with calculations].[Date])
-
AND ([Cruise Names].Ship = [Wecs with calculations].Ship)
-
AND ([Cruise Names].Cruise = [Wecs with calculations].[Cruise Number])
-
WHERE [Wecs with calculations].Ship Like IIf([Forms]![Report Menu]![ship] Is Not Null,[Forms]![Report Menu]![ship],"*")
-
AND [Wecs with calculations].[Date] Like IIf([Forms]![Report Menu]![Sailing date] Is Not Null,[Forms]![Report Menu]![Sailing date],"*")
-
GROUP BY [Wecs with calculations].[Excursion Name],
-
[Wecs with calculations].[Excursion Number],
-
[Wecs with calculations].Ship,
-
[Wecs with calculations].[Date],
-
[Cruise Names].[Cruise Name]
-
ORDER BY [Wecs with calculations].Ship, [Wecs with calculations].[Date];
-
Then put a command button on the form. Cancel the wizard and open the properties.
Call it cmdFind (In the properties window under the other tab in name).
Then under the event tab go down to the On Click event.
Type in or show [Event Procedure] and click on the button with dots to the right.
The code editor will open and you will see the following: -
Private Sub cmdFind_Click()
-
-
End Sub
-
Add the following line substituting the name of your 3rd combo box (found under the other tab in properties windows). -
Private Sub cmdFind_Click()
-
-
Me.Combobox3Name.Requery
-
-
End Sub
-
You should now see the correct list in the third combo box.
There are other ways of doing it but I think this is the easiest way for a beginner.
If you have any problems, let me know. I'll check in later.
Mary
Thanks for your help Mary. Is there a way of doing the requery without making a command button?
Thanks for your help Mary. Is there a way of doing the requery without making a command button?
Because the value of the third combo box is based on the selection of both the other two combo boxes.
You could put the code in the After Update event of the second combo box but if the user changed the second combo box before the first this would cause an problem.
You could put the code in the after update event of both the first and second combo box but I'm not sure if this would work alright.
I chose the command button because I felt it was the best way to control it.
Mary
Ok thanks. What would be the code that goes in the AfterUpdate of the second box? Do I need code in the AfterUpdate of the third box too?
Ok thanks. What would be the code that goes in the AfterUpdate of the second box? Do I need code in the AfterUpdate of the third box too?
It's the same code ....
Just put it in the After Update Event of Combo's 1 and 2
Hi Mary, I have tried this and it doesn't work. The command button didn't work either. It is showing the correct excursions for that ship but not for that date. Do you have any ideas?
Hi Mary, I have tried this and it doesn't work. The command button didn't work either. It is showing the correct excursions for that ship but not for that date. Do you have any ideas?
Are both [Sailing Date] and [Date] correctly formated as Date/Time data types.
Is the combo box returning a valid date?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Mike |
last post by:
I have a combo box and a text box. Text to be display will be contigent
upon what is selected via the combo box. How do I do this?
I put the following code in the text box object:
var a =...
|
by: J. Yuan |
last post by:
Hi,
I am having some problems getting combo boxes to work right. I'm
trying to get a combo box to select all the distinct "invoice numbers"
in a table by using the following SQL statement:...
|
by: Jeff_F |
last post by:
Hi all. Question in two parts. I'm looking to add two combo boxes.
The first will contain regions and the second will contain employee
names which correspond to the region selected in the first...
|
by: RustyMoran |
last post by:
I'm creating a data entry form for my primary table (birds observed)
and want to use a combo box that refers to a lookup table (locations).
I've set the combo box to except new locations (ones not...
|
by: praz |
last post by:
I need to have a combo box which will display the countries
from(Country table) and then user would select the country, which would
display the cites for that particular country, in another combo...
|
by: Steve |
last post by:
currently when I load a new form, i have a combo box that shows the first
item in the list it pulls its data from
the fields are customeridkey and customername
and the code is......
|
by: taras.di |
last post by:
Hi everyone,
I've been reading up on how to create a drop down box who's context is
dynamically produced based on the value of a previous select box. I've
read a lot about some of the browsers...
|
by: AA Arens |
last post by:
Hi I do have a products table and products-parts table in my Access
2003 database and log all services into a form.
I do have at least the following two combo boxes on my form:
- Choose...
|
by: Torilyn73 |
last post by:
I posted this earlier... or thought I did... anyway.. it's doesn't
appear in the list so I'm reposting it.
Can someone please explain to me how to set up the lostfocus event
for a combo box. I...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
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: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |