Is there a way to get a declared variable to be remembered in another routine?
I.e. I have declared the value x below as the ComboBox1.value but when i call 'BuildHCReport' routine the value of x is forgotten i.e. null.
Any help would be greatly appreciated. Thank you in advance.
![]()
Private Sub CommandButton1_Click() Dim x As String If ComboBox1.Value = "Emden HC" Then ''''' If Emden HC report request is selected execute the sub to format the HC report x = ComboBox1.Value Call BuildHCReport Else ''''' Else execute the sub to format the TERMS report x = ComboBox1.Value Call BuildTermReport End If ''''' Display to show report has been formatted MsgBox ComboBox1.Value & " has been formatted!" ''ComboBox1.Value = Null End Sub
Bookmarks