Hi there.

I've got two forms (form1.frm and frmoptions.frm.) The first form contains a variable (multip = 2.) When I click on the first form let's say I want to see that variable in the second form's command button's caption. This doesn't work. All I get is a blank command button (without the variable as the caption.)

I've declared the variable as 'Public' in the General / Declarations section (in the first form.) And I use the code below to see the second form...

frmoptions.Show
frmoptions.SetFocus

Any suggestions? Thanks :)

Recommended Answers

All 2 Replies

in load event of frmoptions have
commandbuttonname.caption = Form1.multip

Thanks plusplus.

I didn't think to use the "form1" part of the code, because I thought this would be automatically known by vb due to the fact that it is a Public variable.

Nice one, thanks :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.