cjmitton
01-23-2014, 08:16 AM
I'm having trouble passing a variable from one form to another. I have a file path as a string declared in one form. Example: \\servers\share1\share2 I've tried to then pass the variable to the other form using FillVars like follows:
' this code runs when checkbox is trueSub get_std_letts() Dim SF As String ' Startfolder is declared in a different macro but is available to this macro as its a public variable SF = StartFolder Load frm_Clt_Letters Call frm_Clt_Letters.FillVars(SF) frm_Clt_Letters.Showend sub'On the other formSub FillVars(ByRef s1 As String)StartFolder1 = s1End Sub' Startfolder1 is public declared as a string and used in the form Inilialize macro.I've used this way of passing on a variable before and its been fine but this is not working now?
' this code runs when checkbox is trueSub get_std_letts() Dim SF As String ' Startfolder is declared in a different macro but is available to this macro as its a public variable SF = StartFolder Load frm_Clt_Letters Call frm_Clt_Letters.FillVars(SF) frm_Clt_Letters.Showend sub'On the other formSub FillVars(ByRef s1 As String)StartFolder1 = s1End Sub' Startfolder1 is public declared as a string and used in the form Inilialize macro.I've used this way of passing on a variable before and its been fine but this is not working now?