L
LAS
I got the following code from http://allenbrowne.com/ser-29.html. The use
of ls_sql instead of "MyTable" is my own. My question is, are all of these
steps necessary if I want to modify ls_sql and re-retrieve a number of times
in the app?
TIA
LAS
On Error Goto Err_MyProc
Dim db as Database
Dim rst As Recordset
Set db = CurrentDb()
'Set rst = db.OpenRecordset("MyTable") original code
Set rst = db.OpenRecordset(ls_sql)
'Useful code here.
rst.Close 'Close what you opened.
Exit_MyProc:
Set rst = Nothing 'Deassign all objects.
Set db = Nothing
Exit Sub
Err_MyProc:
'Error handler here.
Resume Exit_MyProc
End Sub
of ls_sql instead of "MyTable" is my own. My question is, are all of these
steps necessary if I want to modify ls_sql and re-retrieve a number of times
in the app?
TIA
LAS
On Error Goto Err_MyProc
Dim db as Database
Dim rst As Recordset
Set db = CurrentDb()
'Set rst = db.OpenRecordset("MyTable") original code
Set rst = db.OpenRecordset(ls_sql)
'Useful code here.
rst.Close 'Close what you opened.
Exit_MyProc:
Set rst = Nothing 'Deassign all objects.
Set db = Nothing
Exit Sub
Err_MyProc:
'Error handler here.
Resume Exit_MyProc
End Sub