Page 1 of 1

Global variables when using Form Designer

Posted: Thu Jan 10, 2013 10:18 am
by BjornF
I suspect that this is a newbie question but since I don't know the answer... :D

I'm trying to write a new project using the Form Designer. The project uses a SQLite database and the database should be accessible on different forms within the project. Because of this I created a global variable "dbFileName" which I defined in the file Main.pb. However when I try to access the variable in the different form.pb files it is not recognised.

So my questions are:
1. Am I correct in that the "Global" is only valid for one file in the project?
2. Is there any smart way of accessing the file name dbFileName in the different forms?

all the best,

Björn

Re: Global variables when using Form Designer

Posted: Thu Jan 10, 2013 5:00 pm
by Polo
The global variable is defined for all files, but you need to ensure you've defined it before including the form.pb file :)

Re: Global variables when using Form Designer

Posted: Thu Jan 10, 2013 5:11 pm
by BjornF
Thank you for the rapid answer :) That solved the problem.

/Björn