combo box

  • Thread starter Thread starter Luis
  • Start date Start date
L

Luis

Please,

I have two tables in my database. I put only companys
names into first one and employees names into second one.

I created a form with two combo box, after I selected a
company into first combo box I would like second combo box
show only this company's employees.

How can I create this filter into a combo box?

I'm not developer and I have a few knowledge about VBA
language.

Tanks,

Luis
 
In body of procedure on after update combobox with company
names:

Private Sub CompanyCombobox_AfterUpdate()
Dim strSQL as String
Dim sCompany as String

If Me.CompanyCombobox = "" Then Exit Sub

sCompany = Me.CompanyCombobox
strSQL = "SELECT Field1.Employes, Field2.Employes" & _
" FROM Employes" & _
" WHERE ((Employes.CompanyName) = """ & sCompany
& "");"

Me.EmployesCombobox.RecordSource = strSQL

End sub
 
I am having a similar issue. I have a subform with two
combo boxes. The contents of the second (titled
"Subcategory") is based on what is selected in the first
(titled "Category"). The values are based on lists in
queries which are in turn based on tables. This all worked
when it was an Access 2002 database but somehow the
referrencing to controls on subforms seems to have changed
when "converted" to Access 2003.

Is anyone able to shed light on things?

Thanks
 
Back
Top