Random Access File (VB)
-
hi, i have a question...If i open up a Random Access file in a vb form...witha file number.. lets say then i need to unload the form and go to another form...and use the same file number.... can i take the file number acquired while opening one form to another??? how can i do it?? OR is it better to open and close file at every form??instead of keeping the file number???isn't that bad..keep opening and closing the same file in every file??? can u tell me which way is better?? tks for help... Have a Super Blessed Day! ------------------------- For God has not given us a spirit of fear, but of power and of love and of a sound mind. 2 Timothy 1:7 "For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life." John 3:16 "Therefore you also be ready, for the Son of Man is coming at an hour you do not expet." Luke 12:40
-
hi, i have a question...If i open up a Random Access file in a vb form...witha file number.. lets say then i need to unload the form and go to another form...and use the same file number.... can i take the file number acquired while opening one form to another??? how can i do it?? OR is it better to open and close file at every form??instead of keeping the file number???isn't that bad..keep opening and closing the same file in every file??? can u tell me which way is better?? tks for help... Have a Super Blessed Day! ------------------------- For God has not given us a spirit of fear, but of power and of love and of a sound mind. 2 Timothy 1:7 "For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life." John 3:16 "Therefore you also be ready, for the Son of Man is coming at an hour you do not expet." Luke 12:40
If your want to pass the file number around, keeping the file open, you can pass it as a global variable in a .vb module or class file. On the downside, what your doing isn't considered proper programming technique because it is no longer a modular design. If your going to be doing file access from multiple modules (or forms), it's best to write up a set of public functions that handles file access for you. Oh yeah, it is NOT a bad thing to be opening and closing the same file all the time... But, of course, it all depends on what your doing... RageInTheMachine9532