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!

Combo box still giving me a head ache.

Status
Not open for further replies.
Jan 27, 2003
35
0
0
GB
Hi, I have had some sleep now so i might be able to word this correctly.

outline
2 tables organisation and employee
joined by company number i.e. microsoft id 1
bob and geoff work for microsoft therefore they have a 1 set against them in the employee table.

i have two forms. the first selects the organisation you want i.e. microsoft (this is done via a combo box). There is a button on the organisation form that opens a second form and shows only the employees that work for microsoft. (this bit works but i have to flick through them using the record bit at the bottom - not very user friendly)

what i would like is a combo box on the second form that will only show the filtered employees - at the moment i can only get it to show every employee in the table regardless of organisation.
 
Have you looked at the FAQ section of this site, you should find the first item in the category Combo Boxes should help Regards
 
Hi

Basically on the second form, (ie the one showing Employees), you need an unbound combo box, the recordsource of which is a query, with a criteria on Organisation column, of Forms!MyForm!MyCombo, where MyForm is the name of your firat form, and MyCombo is the name of the combo box on that form

Then in the after update event you need go to move to the selected record.

If you look in FAQ of this forum there is at least one FAQ on the subject, titled "Using Combo Box as a navigation tool"

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
thank you chaps i will have a look - i might need a bit of hand holding though.
 
It is easy if you connect both forms with Company ID.
Something Like this
Code:
Private Sub CmdOpenSecondForm_Click()
    Dim stDocName As String
    Dim stLinkCriteria As String
    stDocName = "SecondFormName"
    stLinkCriteria = "[CompanyID]=" & "'" & Me.[CompanyID] & "'"
    DoCmd.OpenForm stDocName, , , stLinkCriteria, , acDialog
End Sub
HTH

________________________________________
Zameer Abdulla
Visit Me
A child may not be able to lift too much.
But it can certainly hold a marriage together
 
Pardon me...I have posted without refreshing the page

________________________________________
Zameer Abdulla
Visit Me
A child may not be able to lift too much.
But it can certainly hold a marriage together
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top