PLZ help me. I am new in Access. I am creating a contact database. I need to create cascading list for forms. I have 4 cascading list:
cboTipiOrganizata that define the type of organization, depended of the chose it select one of 4 tables of the types of organization, the after update event procedure is:
Private Sub cboTipiOrganizata_AfterUpdate()
On Error Resume Next
Select Case cbotipiorganizata.Value
Case "Institute Kerkimore"
cboOrganizataEmri.RowSource = "tlbInstituteKerkimore"
Case "Institute Publike"
cboOrganizataEmri.RowSource = "tlbInstitutePublike"
Case "NGO"
cboOrganizataEmri.RowSource = "tlbNGO"
Case "SME"
cboOrganizataEmri.RowSource = "tlbSME"
Case "Universitet"
cboOrganizataEmri.RowSource = "tlbUniversitet"
End Select
End Sub
The result is showed at cboEmriOrganizata, where we chose the name of the organizatin
If the chose in tlbUniversiteti (tblUniversity), i have one more cascading list to define the faculty named cboFakultetiEmri
In the after update event procedure of cboEmriOrganizata i have put this code:
Private Sub cboOrganizataEmri_AfterUpdate()
Dim sFakulteti As String
sFakulteti = "SELECT [tlbFakultet].[emri_fakultet]," & _
"[tlbFakultet].[id_fakultet]," & _
"[tlbFakultet].[emri_universitet]" & _
" FROM tlbFakultet " & _
" WHERE [emri_universitet] = " & Me.cboOrganizataEmri.Value & ";"
Me.cboFakultetiEmri.RowSource = sFakulteti
Me.cboFakultetiEmri.Requery
End Sub
When i chose the University name (at cboUniversitetiEmri combo) and then go to chose the Faculty name (at cboFakultetiName) i give the follow error:
Syntax error (missing operator) in query expression '[emri_universitet]=ABC University'.
Where ABC University is one of the name of the university recordet in table
Thanks in advance!