Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combox box base on previous combo box

Status
Not open for further replies.

paulbasi

Technical User
Jun 21, 2002
14
0
0
CA
It’s been a few years since I have worked with MS Access so please forgive my newbeeness.
I am trying something very simple and I have done it before but for the life of me, I can’t remember how. I have searched for over a week and just can’t seem to make it stick in my head.
Here is my last attempt:
I have a table tblTQdb which will store all the records created by users.
I have another table tblResolution from where data will be pulled.
My goal is to create an FAQ database for users throughout the office
I want to create a form with several combo boxes.
Box one asks “What system?” This data will come from column 1 of my tblResolution (Need to do this without duplicates)
Box two asks “What Component?” This data must come from the result of the first selection.
I have tried to create a query which is run AfterUpdate of the first combo box.
Then I took the second combo box and pulled the data from that query.
This worked great for the first selection but if the user changed their mind, it would not update the second combo box.
Example is, if a user selects hardware as the system, the component will only give hardware options such as keyboard, mouse, monitor …
If the user changes their mind and selects software, the Component box still gives them the hardware selections.
Further to this, I want the third combo box to rely on the second combo box.
Are there any samples on here? I have looked and googled this with no success.

Any help is greatly appreciated and thank you in advance.
 
Thank you for the responses. I don’t know why I just can’t grasp this. I have tried the sample that you have given me and of course my tables are different so I substituted names but it just won’t work for me. I have been trying to get this to work for more than a week and I am now totally frustrated. Not sure if it makes any difference in Access 2003 but I think it’s time to pull the plug and perhaps hire someone to do this for me.
 
How are ya paulbasi . . .

Post the [blue]RowSource[/blue] of both comboboxes along with the code in the [blue]After Update[/blue] event of the 1st combo . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
TheAceMan1 ,
Thanks for responding. I think I'm just stuck in an endless loop here. I know it's probably something very simple and I'm just too stupid to figure it out. I think I'm going to have to go and buy a book ... do they publish one "Access for dumb asses"? :)

Cheers and thanks for trying to help me out.
 
paulbasi
Do not give up. If you have done this before, you can do it now. Can you attach a zipped database using the attachment links below?
 
Please don't take this as me having someone do my work for me. I feel guilty about this but I'm stuck.
Here is a copy of the db

I can't seem to attach the db as I'm behind the company firewall and it won't allow me to upload anything to a website. I will need to email this to myself and upload it from there.
Thanks again.
 
Ok. Here is a start:

Code:
Change:

Combobox System:
Row Source: SELECT DISTINCT [tblResolution].[System] FROM tblResolution; 

Combobox Component:
Row Source: SELECT [tblResolution].[Component], [tblResolution].[System] FROM tblResolution WHERE [tblResolution].[System]=[Forms]![frmCreateNew]![System] 

qryResolution:
SELECT tblResolution.System, tblResolution.Component, tblResolution.Item, tblResolution.Issue, tblResolution.Resolution
FROM tblResolution
WHERE (((tblResolution.System)=[Forms]![frmCreateNew]![System]));

Code:
Private Sub System_AfterUpdate()
    Me.Component.Requery
End Sub

Try these changes and see if things are now going the way you want.
 
Wow, this was excellent. Thank you so much for this little bit, it helped me greatly.
You have made my Friday much better. Have a great weekend!

-Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top