if i have two forms or more. how do i grab a variable from form1 and use it in form2?
thank you
steve
Printable View
if i have two forms or more. how do i grab a variable from form1 and use it in form2?
thank you
steve
In form1
something = form2.variable_name
Or In form2
something = form1.variable_name
ah thanx
Use custom properties - they allow to read/write without having form loaded (it will intialize only). Let me know if you need some sample code for that.
Has to be Public in the first form:
form1:VB Code:
Option Explicit Public s$ Private Sub Form_Load() s = Format(0.25, "#,0.00") Form2.Show End Sub
form2:
VB Code:
Option Explicit Private Sub Form_Load() MsgBox Form1.s End Sub
Or put the variable into a module.
casey.
thanx dglienna works perfectly now