Welcome to the forums.![]()
Take your variables out of your sub routine, and put them in the declarations selection of the module and make them publicWhen declaring variables, follow these guidelines:VB Code:
Option Explicit Public con As ADODB.Connection Public rs As ADODB.Recordset Public constring As String
Public: For use through out the project. Declare them in declarations section of a module.
Private: For use through a specific form. Declare them in the declarations section of the form.
Dim: For use only within a specifc sub/function/control event.




Reply With Quote