Martyh
Registered User.
- Local time
- Today, 17:36
- Joined
- May 2, 2000
- Messages
- 196
People,
I have a code tidbit that I can't seem to make work...
**************************************************
Dim dbs As DAO.Database, qdf As QueryDef, rst As Recordset
dim strSql as string
Set dbs = CurrentDb
strSQL = "Select * from tblLocation"
Set qdf = dbs.CreateQueryDef("ParameterQuery", strSQL)
qdf.Execute 'down to here everything works
'What's the problem with the next statement ? I am trying to open the recordset based on the query definition to see if there are any records. It is this statement that my program fails at! Is there some other way to get at the number of records in that set? ( I Forgot to add --- runtime error code 3219 --- Invalid operation ... Why?
'---------------------------------------------
Set rst = qdf.OpenRecordset
If rst.RecordCount <= 0 Then
If strType = "NE" Then
MsgBox ("You have no records in the table within " & dblRadiusR & " metres of this site.")
End If
End If
GoTo Exit_cmdFindWells_Click
Else
Call NewIndex("tblTEMP", "Radius")
DoCmd.OpenForm stDocName
End If
************************************************************
I have a code tidbit that I can't seem to make work...
**************************************************
Dim dbs As DAO.Database, qdf As QueryDef, rst As Recordset
dim strSql as string
Set dbs = CurrentDb
strSQL = "Select * from tblLocation"
Set qdf = dbs.CreateQueryDef("ParameterQuery", strSQL)
qdf.Execute 'down to here everything works
'What's the problem with the next statement ? I am trying to open the recordset based on the query definition to see if there are any records. It is this statement that my program fails at! Is there some other way to get at the number of records in that set? ( I Forgot to add --- runtime error code 3219 --- Invalid operation ... Why?
'---------------------------------------------
Set rst = qdf.OpenRecordset
If rst.RecordCount <= 0 Then
If strType = "NE" Then
MsgBox ("You have no records in the table within " & dblRadiusR & " metres of this site.")
End If
End If
GoTo Exit_cmdFindWells_Click
Else
Call NewIndex("tblTEMP", "Radius")
DoCmd.OpenForm stDocName
End If
************************************************************
Last edited: