AccessAmateur
Registered User.
- Local time
- Today, 15:46
- Joined
- Feb 13, 2003
- Messages
- 30
Why do I get 'runtime error 3061 too few parametrs' error with the 'Set rstName = .OpenRecordset()' staement in this:
I've followed the example in the help files as close as I could.
Next Question: The MsgBox gives a type mismatch error because rstName is not a String. How go I make a RecordSet into a String?
Private Sub InspNum_DblClick(Cancel As Integer)
Dim dbs As Database
Dim rstName As Recordset
Dim qdf As QueryDef
Set dbs = CurrentDb
Set qdf = dbs.CreateQueryDef("")
With qdf
.SQL = "SELECT Name FROM List WHERE List.Num = " & Me.Num & " ;"
Set rstName = .OpenRecordset()
End With
'MsgBox "Name is " & rstName
I've followed the example in the help files as close as I could.
Next Question: The MsgBox gives a type mismatch error because rstName is not a String. How go I make a RecordSet into a String?
Private Sub InspNum_DblClick(Cancel As Integer)
Dim dbs As Database
Dim rstName As Recordset
Dim qdf As QueryDef
Set dbs = CurrentDb
Set qdf = dbs.CreateQueryDef("")
With qdf
.SQL = "SELECT Name FROM List WHERE List.Num = " & Me.Num & " ;"
Set rstName = .OpenRecordset()
End With
'MsgBox "Name is " & rstName