|
-
Jan 26th, 2000, 07:47 PM
#1
Hi,
I tried passing a global variable in the general declaration section of a module in Form1 so that a recordset in a second module in Form2 could read the variable. Whenever, Form2 is loaded to read the below SQL syntax in the VB code, it comes with an error message "variable not defined" with SQLconnect highlighted. Any help on this problem would be appreciated. Thanks
Albert.
rsDat.Open SQLconnect,CnData, dbOpenDynamic
SQLconnect = "Select OrderID,OrderDate from Employees, Orders Where Employees.[EmployeeID] = Orders.[EmployeeID]" _
& " And Lastname='" & Combo1.Text & "'"
-
Jan 26th, 2000, 10:52 PM
#2
Junior Member
Hi Albert,
Declare the variables in your "module.bas" program like below.
Public GlobalCaseNbr As String
Public GlobalPartNbr As String
Public GlobalMedRecNbr As String
Public GlobalDate As String
Public GlobalFound As String
Public AddRespString As String
Public frmMain As frmMain
Sub Main()
frmSplash.Show vbModal ' Show the Splash Screen
If SplashOk Then
Unload frmSplash
End If
Then the variables will be available through out the whole application.
Jim
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|