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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

public variables scope

Status
Not open for further replies.

nivini

Programmer
Mar 24, 2004
64
0
0
Hello guys
I have a variable problem, it goes like this:

in Module1 I declared :
public formID as string

in Form1 I set:
Module1.formID=Str(Day(Date) & Month(Date) & Year(Date))

in Form2 I want to see Module1.formID like this
Text1.text=Module1.formID

but Text1 remains empty. I could see it in Form1 , but it "died" somewhere in Form2
What is wrong with my proccess
I'm sure youll find it in no time,
thanks
nivini

 
It works o.k. for me. Even calling it from the Form1 Load Event.

I don't use the Module1.formID=Str(Day(Date) & Month(Date) & Year(Date)). I don't know if it's good practice but I never include it.

[gray]Experience is something you don't get until just after you need it.[/gray]
 
in Form1 I set:
Module1.formID=Str(Day(Date) & Month(Date) & Year(Date))

The important question is, in what event is this code, and has this event fired before your other code attempts to retrieve the value?

Like Error7, I never include the module name when referring to a public variable.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top