Hi all,
I could not figure out why this code not working? The query works perfectly when i ran it in Access. I don't know whey it is not working here?
The query result is get the record in NameTbl where NameId eq selected name list id on form.
Any helps will be appreciated. thanks.
Dim dbs As Database
Dim rst As DAO.Recordset
Dim strSQL As String
Set dbs = CurrentDb()
strSQL = "SELECT NameTbl.* from NameTbl where NameTbl.[NameID]=CInt(Me.ChooseListBox.Value)"
Set rst = dbs.OpenRecordset(strSQL, Type:=dbOpenDynaset)
I could not figure out why this code not working? The query works perfectly when i ran it in Access. I don't know whey it is not working here?
The query result is get the record in NameTbl where NameId eq selected name list id on form.
Any helps will be appreciated. thanks.
Dim dbs As Database
Dim rst As DAO.Recordset
Dim strSQL As String
Set dbs = CurrentDb()
strSQL = "SELECT NameTbl.* from NameTbl where NameTbl.[NameID]=CInt(Me.ChooseListBox.Value)"
Set rst = dbs.OpenRecordset(strSQL, Type:=dbOpenDynaset)