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

PASSING VARIABLE FROM ONE FORM TO ANOTHER

Status
Not open for further replies.

autoIT

IS-IT--Management
May 10, 2006
68
US
how do i pass a value ina variable from one for to the next?
 
In the new from, refer to the variable as [oldform].variable...


Hope that helps!
Brett
 
Option Compare Database

Option Explicit
Dim Rep As String


Private Sub Form_Load()
Form_Input.cboRep.SetFocus
Rep = Form_Input.cboRep.Text



Like this, still doesnt get the variable, could it be b/c its attempting to get a value from a combo box?
Is there a way to set a Variable = to the combo box and retrieve the value from that variable on the old form?
 
I'm thinking that may be the case, but I know there is a way to get a value of a combo box. For now try this.

Create a Public (global) variable on your form at the top.
Set it's value to whatever the value is on the combobox just before you switch to the new form.
Call the global variable with [OldForm].GlobalVariable.

See if that helps. I'm thinking you may need to look at the value of the combobox or something. I'm not sure.

I hope this helped for now.
Brett
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top