fiogf49gjkf0d Hi, thanks for the reply
I understand what I need to do and have a form1 where I have declared a Public Variable and have populated the variable with the content of a field which I have tested through a message box and it seems to be storing it okay.
My issue is when I call the other form (form2) i'm getting an error saying that the variable (form2) has not been defined. Form2 is the name of my form????
The code is shown below:
Have I defined the Public variable correctly? - Do I need the to do something different with Form1 so that Form2 can see it? as it seems to think it is a variable and not a form.
Form Name: frmAddEditSupplier
option explicit
Public varSupplierID
Sub AXFormChange(Sender) varSupplierID=txtDCLSupplierID.Text End Sub
'sub SupplierVariableClick(Sender) 'msgbox varSupplierID 'End Sub
Sub SupplierCommissionsClick(Sender) Application.BasicFunctions.DoInvoke "Form","Personal:DCL Manage Supplier Commissions" End Sub
Form Name: frmSuppCommissions
option explicit Sub AXFormOpen(Sender) txtVarSupplierID.text=frmAddEditSupplier.varSupplierID
grdSuppCommissions.SQL = "SELECT S1.DCLSUPPCOMMISSIONID, S1.DCLSUPPLIERID, S2.SUPPLIER, S1.BAND, S1.DD_AMT, S1.INCOMP_DEALS, S1.NC_PRICE, S1.RNW_PRICE, S1.NP_UPFRONT_CC, S1.NP_UPFRONT_DD FROM DCLSION S1 LEFT OUTER JOIN DCLSUPPLIER S2 ON S1.DCLSUPPLIERID=S2.DCLSUPPLIERID " grdSuppCommissions.Refresh End Sub
As I said the variable is being captured from the first form(frmAddEditSupplier) but when the 2nd form is opened I get the script error:
" Variable is undefined: 'frmAddEditSupplier' "
Can anyone shed any light as to why this is falling over?
Thanks
Dave |