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

Dropdown Boxes

rcollins
234 100+
I have 2 dropdown boxes on my form, both which pull from table I made for each. First I select the Service that I want, then I want the Service Type to be limited to the types only with the Service ID that matches the ID from the first box. How do I implement this?
Dec 19 '06 #1
10 1703
tara99
106 100+
I have 2 dropdown boxes on my form, both which pull from table I made for each. First I select the Service that I want, then I want the Service Type to be limited to the types only with the Service ID that matches the ID from the first box. How do I implement this?
Try something like this behind your combo box's row source
Expand|Select|Wrap|Line Numbers
  1. SELECT table.servicetype FROM table table.service HAVING (((table.service)=forms!YourformName!Sevice-Combobox-name)); 
  2.  
Dec 19 '06 #2
rcollins
234 100+
SELECT table.tblServiceType FROM table table.tblService HAVING (((table.tblService)=forms!frmMain!Combo24));
I think i changed this right. Here are the names I am using for the different items:
Tables are
tblService
tblServicetype
Form is
frmMain
Combo box is
Combo24
this is not an extensive database, this shouldnt be to hard to do. When I modified what you gave me, I have nothing in the Service type box
Dec 20 '06 #3
missinglinq
3,532 Expert 2GB
This concept is called Cascading Comboboxes. Here's a fairly good explanation and example code:

http://www.mvps.org/access/forms/frm0028.htm
Dec 20 '06 #4
rcollins
234 100+
Very good example. The only problem is that now I have the ID showing in the second dropdown, not hte ServiceType.
Dec 20 '06 #5
MMcCarthy
14,534 Expert Mod 8TB
Very good example. The only problem is that now I have the ID showing in the second dropdown, not hte ServiceType.
You need to change the column widths property to hide the ID and make sure your column count = 2.

Column Count 2
Column Widths 0cm; 3cm (For example)

Mary
Dec 21 '06 #6
rcollins
234 100+
Here is what I have done, Now it doesn't work at all.
From the website sent to in previous post
Private Sub Combo24_AfterUpdate()
Dim strSQL As String
strSQL = "Select " & Me!Combo24
strSQL = strSQL & " from Categories"
Me!Combo46.RowSourceType = "Table/Query"
Me!Combo46.RowSource = strSQL
End Sub
Combo24 is my first box and 46 my second
Then put this in row source of Combo46
Select ServiceIDID, Service from tblService Where ServiceID= Forms!frmMain!Combo24;
Then in after update of Combo 24 put
Private Sub Combo24_AfterUpdate()
Me!Combo46.Requery
End Sub
This isnn't working. Contact by email if easier, I am supposed to have this database finished today and this is all that is left. Thanks for helping. rcollins@mds.acsol.net
Dec 21 '06 #7
MMcCarthy
14,534 Expert Mod 8TB
Expand|Select|Wrap|Line Numbers
  1.    strSQL = "Select " & Me!Combo24
  2.    strSQL = strSQL & " from Categories"
  3.     Me!Combo46.RowSourceType = "Table/Query"
  4.     Me!Combo46.RowSource = strSQL
  5.  
This doesn't make sense. Me!Combo24 is a value not a field name. You can't select a value from a Table

Mary
Dec 21 '06 #8
rcollins
234 100+
Thank you for your responce. I actually had to change some things in my database, but I got it to work following an examlpe that I found online. Thanks
Dec 21 '06 #9
MMcCarthy
14,534 Expert Mod 8TB
Thank you for your responce. I actually had to change some things in my database, but I got it to work following an examlpe that I found online. Thanks
No problem

I'm glad you got it working

Merry Christmas

Mary
Dec 21 '06 #10
rcollins
234 100+
So here I go again, on a different database. I have a form and subform where I input client names and the employers that they work for, frmClientJob and frmClientJobs Subform. I have a dropdown box called Employer that pulls the employer name from tblEmployer, the I have a table tblEmployerJobs where I have what jobs each employer has. I want the Employer dropdown to only have the jobs that go to the employer that is picked from the employer dropdown. Last time I did this in the other database, I had seperated the info to different tables, then had it show just the info in the specific table.I can not do that here, because the table information changes. Can you help me?
Jun 5 '07 #11

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

Similar topics

2
by: reneeccwest | last post by:
Different user input boxes are automatically populated based on a value of the dropdown box. Can anyone help me on that?
2
by: ahoodless | last post by:
hi i have a problem that I have tried desperately to tackle but cannot seem to complete. basically i am trying to create a form with three dropdown lists, the tricky part is i want the 3rd drop...
6
by: Mark | last post by:
I have two dropdown lists. Both have autopostback set to true. In both dropdowns, when you select an item from the list, it redirects to the Value property of the dropdown. Nothing fancy. ...
2
by: Cheryl | last post by:
I have grabbed a menu from a javascript site ( http://www.dynamicdrive.com/dynamicindex1/topmen3/index.htm ) and added to my page. The problem is however the dropdown comes down on top of text and...
1
by: | last post by:
im dynamically loading dropdown boxes on page.load like this : cbo1.Items.Add("") cbo1.Items.Add("OT") cbo1.Items.Add("ST") cbo1.Items.Add("Ho") cbo1.Items.Add("FMLSK")...
1
by: gary | last post by:
In our site we are encountering problems with drop down boxes. We have a dropdown box & the ONChange event of which is fetching some data from a servlet. However when we use history back button ,...
5
by: Gil | last post by:
Is there a way to tell if a combbox is in dropdown mode. I tried and if statement combobox.dropdown = true but i get an error. dropwndown function doesnt store if its true or false what i am...
2
by: Jason James | last post by:
Hi, I have a datalist that contains a series of thumbnails. I am in the process of paging this datalist so that only 20 images are displayed at a time. Each image has associated with it a...
0
by: Kitten | last post by:
I'm maintaining a site which has a page to show information by the date. It has 3 dropdown boxes - day, month and year. Day is sorted already. The year must only show this year and last year,...
8
by: Wingot | last post by:
Hey, I have a program I am trying to write using Visual C#, SQL Server 2005/2008, and Visual Studio 2008, and one part of it includes a Schema called Client. Inside this schema, three tables...
1
isladogs
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...
0
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...
1
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)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
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
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
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 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.