duanecwilson
Programmer
I have several different controls on a form that refer to another form's combobox. I was setting it fresh in many different procedures and event procedures. I thought to, like private variables for the module to set them also once in the declaration section, and was able to Dim them, but I couldn't "set" them as "set" wasn't valid outside of a procedure. I was given an idea to do it in a separate procedure, function, or class, but haven't been able to do it. It seems simple, I just want to set it once and forget it. I would like to learn how to do it in a class module if possible (property get, let, etc.) but wouldn't mind it being in a procedure or function. Here is some code I have used but it doesn't work:
Option Compare Database
Option Explicit
'This is the column number from the combobox in Wave1Select that contains SRC_CUST_ID
Public intSrcCustIDidx As Integer
Dim frm As Form
Set frm = Forms!frmWave1Select
Dim cboSelection As Control
Set cboSelection = frm!cboWave1Select
Dim modcancel As Boolean
Dim strSRC_CUST_ID As String
-------------------------
Private Sub .... etc.
...
...
End Sub
-------------------------
I am not sure of the scope of the set statement. I don't know if I can set it and retrieve it in a standard module, a class module, or just the form's module. And I don't know if I could or should do it global. Thanks for any help here.
Duane Wilson
Option Compare Database
Option Explicit
'This is the column number from the combobox in Wave1Select that contains SRC_CUST_ID
Public intSrcCustIDidx As Integer
Dim frm As Form
Set frm = Forms!frmWave1Select
Dim cboSelection As Control
Set cboSelection = frm!cboWave1Select
Dim modcancel As Boolean
Dim strSRC_CUST_ID As String
-------------------------
Private Sub .... etc.
...
...
End Sub
-------------------------
I am not sure of the scope of the set statement. I don't know if I can set it and retrieve it in a standard module, a class module, or just the form's module. And I don't know if I could or should do it global. Thanks for any help here.
Duane Wilson