[XL2003] get results from a subform back to the main form

  • Thread starter Thread starter Dirk Schwidde
  • Start date Start date
D

Dirk Schwidde

hi,

let's say an VBA application has a main form with a button.
A click on that button opens another form, the 'subform'.

On the subform the user can choose from alternatives by using
radiobuttons.

How do I get the choice back to the main form to do some
calculation with it?

Regards
Dirk
 
Dirk Schwidde was thinking very hard :
hi,

let's say an VBA application has a main form with a button.
A click on that button opens another form, the 'subform'.

On the subform the user can choose from alternatives by using
radiobuttons.

How do I get the choice back to the main form to do some
calculation with it?

Regards
Dirk

In concept, probably the easiest way would be to use a public var in
your 'main form', that you can pass a value to when the user clicks one
of the radiobuttons in the 'subform'.

In main form declarations area:
Public MyVal As Variant '//to hold any data type


In the subform:
In the radiobutton_click event:
MainForm.MyVal = SomeValue
**I would use one of the type conversion functions here so that MyVal
contains a value readily usable for calcs. (Though, this not really
necessary as you could convert inside the calc process)

If your radiobuttons are in different groups then add a public var for
each group.
 
In concept, probably the easiest way would be to use a public var in
your 'main form', that you can pass a value to when the user clicks one
of the radiobuttons in the 'subform'.

Thanks a lot, works great!

Dirk
 
Back
Top