Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using an Existing Variable as a condition for a New Sub 1

Status
Not open for further replies.
Apr 9, 2002
102
US
I have the following sub that I would like to call multiple times within the code of another sub:

Public Sub DeleteTable(rsName As String)

rsName.MoveFirst

Do Until rsName.EOF = True
rsName.Delete
rsName.MoveFirst
Loop

End Sub

The rsName condition will contain the name of the recordset that I want to be affected. How can I alter this code to make this work?? I appreciate any help you can offer. Thanks.

Marrow
 
I believe to pass this way would require rs to be an object. It is not a string but a pointer to a recordset - an object.
 
May be better off setting rs as a recordset variable, and not just an object ... would make your code run a little bit faster ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top