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

passing parameters between forms 3

Status
Not open for further replies.

cebu

Programmer
Joined
Jan 20, 2001
Messages
1
Location
US
i have declared a public string varible 'tcommand' in a module.
in form #1, I call form #2 to get user input (check boxes). the check boxes, if checked, are set to A,B,C,... in a string. this string is concatenated with 'tcommand'. i want
'tcommand' to be returned to form #1 and saved in a text file. everything works ok except that the returned 'tcommand' is always empty. i can show 'tcommand' in a message box in form#2 and it is correct there.

any help on this woould be greatly appreciated.

thanks
 
tcommand must be declared in a standard module in order to be visible to form #1. If you declared it in form #2's module, that's your problem. (But then you should have had a compile error, unless you have tcommand declared in more than one place.)

When you say form #1 "calls" form #2, what do you mean by that? Is it opening form #2 as a modal dialog? If not, then form #1 will continue to run its code before form #2 has even been displayed. That could mean form #1 grabs the value of tcommand before form #2 has a chance to set its value.

Otherwise, you must be erasing tcommand somehow when you close form #2. Find all the "tcommand =" statements in your application and tell us the names of the procedures in which they are located.
Rick Sprague
 
cebu -
I posted a long answer to this very question, including sample code, in the FAQ area.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top