J
Jasonm
Hi all (again),
I am trying to add records to the subform based upon a selection in the
mainform. I am using the following code to try and get to the records that I
want:
Dim rs As DAO.Recordset ' declare a variable for the recordet
Dim db As DAO.Database ' declare a variable for the database
Dim strSQL As String ' declare a variable for the sql string
Dim intCount As Integer
Set db = CurrentDb ' set the db to the current database
Set rs = db.OpenRecordset("tblConstituent", dbOpenDynaset)
intCount = rs.RecordCount ' use this to count records retrieved
I am not getting any errors with any of the above code, but the number of
records recieved is only 1 and there are probably 12 in the actual table I
am trying to get to.
I have also tried the following:
Set rs = db.OpenRecordset("SELECT * FROM tblConstituent", dbOpenDynaset)
I am getting the correct field names when I step through the code, but still
no records...
Is there something wrong with the above code? Any help would be appreciated.
Jasonm
I am trying to add records to the subform based upon a selection in the
mainform. I am using the following code to try and get to the records that I
want:
Dim rs As DAO.Recordset ' declare a variable for the recordet
Dim db As DAO.Database ' declare a variable for the database
Dim strSQL As String ' declare a variable for the sql string
Dim intCount As Integer
Set db = CurrentDb ' set the db to the current database
Set rs = db.OpenRecordset("tblConstituent", dbOpenDynaset)
intCount = rs.RecordCount ' use this to count records retrieved
I am not getting any errors with any of the above code, but the number of
records recieved is only 1 and there are probably 12 in the actual table I
am trying to get to.
I have also tried the following:
Set rs = db.OpenRecordset("SELECT * FROM tblConstituent", dbOpenDynaset)
I am getting the correct field names when I step through the code, but still
no records...
Is there something wrong with the above code? Any help would be appreciated.
Jasonm