I am a novice in access, learning it on my own by trial and error. please guide and help.
I have two list boxes, I want the second one to be populated based the selection in the first one. I have the below code but it does not seem to work.
Private Sub lst_servicetype_LostFocus()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim MyVal As Long
Dim strSql As String
Set db = CurrentDb()
If Me.lst_servicetype.Value = "Attractions" Then
strSql = ("Select Attraction from SingaporeAttractions_Master order by attraction")
Set rs = db.OpenRecordset(strSql, dbOpenDynaset)
Me![lst_servicedtls].RowSourceType = "Table/List"
Me![lst_servicedtls].RowSource = rs
Me![lst_servicedtls].Requery
rs.Close
Set rs = Nothing
End If