form/query issue

12BM34

New member
Local time
Today, 05:37
Joined
May 22, 2008
Messages
6
hello all

i have an access database which i have attached. i have created a form with some drop down boxes that link to my tables.

Problem: i want my 2nd drop down box to display options only available to the option selected in the first box.

AND

i want my third drop down box to display options only availble to the option selected in the 2nd drop down box. and so on.

can someone please help with this?

hope this makes sense.

thanks for looking :)
 

Attachments

Hi 12BM34
I got this code from Martin Green at fontstuff.com
just change the names of the cbos and fields to match your form


Private Sub cboLastName_AfterUpdate()
On Error Resume Next
cboFirstName.RowSource = "Select tblClientDetails.FirstName " & _
"FROM tblClientDetails " & _
"WHERE tblClientDetails.LastName = '" & cboLastName.Value & " ' " & _
"ORDER BY tblClientDetails.FirstName;"
cboFirstName.Requery
End Sub
 
Re:

thanks for the reply.

im gonna sound really stupid now but i dont know what cbo is.
 
cbo is Combox
on your combox in your form in the properties the name will be comb23 or any number
Change it to cbo then give it a meaningful name, normall what the combobox does.

Gaz
 
Cry for help

Hello all and thank you for your replies.

i have tried both suggestions and i havent been able to do it successfully. im going to be cheeky now. attached previously is a very small database. if someone will be kind enough to sort my combo boxes out, i will be very greatful. i have deadline for friday 5pm GMT and was meant to be working on this with someone else. he's called in sick! i need help please.

thank you all.
 
How is one to test when there's no data available? I also see no attempt to make it work. The combo's do not refer to each other, and there's no code adjusting them. Make an effort and post that so we can fix it if you're still stuck. I'll help with your homework, but I won't do it for you.
 

Users who are viewing this thread

Back
Top Bottom