View Full Version : Passing varibles from one form to another
George Hallam
12-20-2008, 01:41 PM
Hey,
i have two varibles i would like to pass from one form to another (form1, form2)
i have tried it in a module but... it doesnt seem to work on the second form
thank you for any help :D
~George
Paul Komski
12-20-2008, 09:11 PM
It's a bit unclear what you are trying to do. One method is to have an invisible text box on the second form and to set its value from the first form and then use this value, in whatever way you want, from any functions or events in the second form.
A better outline of what you want to do or achieve could be helpful.
The use of public functions in global modules also has its uses and values can be passed to them when called just as they can with form modules.
George Hallam
12-22-2008, 02:20 AM
Right i have managed to have one variable from one form to another using the invisible text box :)
Now i am trying to learn how to read write, right etc with Random access files, do you know any good tutorials? ;)
~Thank you George
Paul Komski
12-22-2008, 03:22 AM
I don't really "know" of any good tutorials but google found http://www.vb6.us/tutorials/working-random-access-files-vb
I have tended to write stored info to ini files or the registry or would use a more formal database if needing to access specific data so Random Access files are not something I am accustomed to using.
Google and the MSDN library have been my greatest "on-line/CDROM friends" when learning to program.
Learning how to use the fso (file system object) can be very useful ways of reading and writing and appending to whole files - though that is not what you are currently asking about with regard to Random Access files. They are something you might want to read up on in the future.
tommy
12-23-2008, 04:48 AM
[QUOTE=George Hallam;415817]Now i am trying to learn how to read write, right etc with Random access files, do you know any good tutorials? /QUOTE]
I would look primarily to the user manuals for the program/data base access that you are using.
The syntax for the program/data base would tell you how to specify:
1- The fact that you are defining a RANDOM file,
2- The length of each record (since all records in a simple random file are of equal length),
3- The means of defining the file name.
4- The means of defining the record(s) layout (so you can access individual fields in the record).
5- The syntax for physically accessing specific records (read/write, get/put , etc).
vBulletin v3.6.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.