Assigning value to Public variable? (1 Viewer)

mahmudich

Registered User.
Local time
Today, 09:32
Joined
Feb 10, 2003
Messages
73
Hi guys!

I won’t believe it, but I’m having problem when I try to assign value to a Public variable for a Form. In “General Declaration” part I write:

Public strSQL as String ‘ this part goes fine
StrSQL = “ SELECT …blah, blah, blah…” ‘ this part goes wrong, I get errors

How can I assign value for a Public variable in a Form?

Cheers
 

FoFa

Registered User.
Local time
Yesterday, 18:32
Joined
Jan 29, 2003
Messages
3,672
Public strSQL as String ‘ this part goes fine
StrSQL = “ SELECT …blah, blah, blah…” ‘ this part goes wrong, I get errors

Do you have a seperate variable named StrSQL vs strSQL or is that just a typo?
 

mahmudich

Registered User.
Local time
Today, 09:32
Joined
Feb 10, 2003
Messages
73
Hi FoFa!

Sorry, my fault, I misspeled second line, strSQL the only variable:

strSQL = “ SELECT …blah, blah, blah…”


Thank you
 

jca

I need to think it over !
Local time
Yesterday, 19:32
Joined
Aug 1, 2001
Messages
42
Why don't you put the
Code:
strSQL = "SELECT …blah, blah, blah…"
part in Form_Open
 

FoFa

Registered User.
Local time
Yesterday, 18:32
Joined
Jan 29, 2003
Messages
3,672
OH, you are not trying to assign the value to strSDQL in the declaratives section are you?
If it is a constant, you can use CONST instead of a variable, but need to assign the value some where else if you are using a variable. Usually right before you use it.
 

Users who are viewing this thread

Top Bottom