S
Shane Wierenga
I am trying to transfer the name of a combobox to my sub procedure.
Here is what I have so far. Obviously this keeps passing the name of
the combobox in quotations. If someone could let me know what I'm
doing wrong it would make my life alot easier.
Private Sub Line1Type1_DropButtonClick()
Dim strlinenum1 As Variant
Dim strlinenum2 As String
strlinenum1 = line1type1.Name
strlinenum2 = line1type2
L1T1 strlinenum1
End Sub
Sub L1T1(strlinenum1 As Variant)
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim strsql As String
Dim strcb2 As String
strsql = "SELECT DISTINCT 'Electrical', 'none' from materials"
cnn.Open strcnn
rst.Open strsql, cnn, adOpenStatic
rst.MoveFirst
ActiveSheet.strlinenum1.List = Application.Transpose(rst.GetRows)
ActiveSheet.strlinenum1.Clear
ActiveSheet.line1type2.Clear
ActiveSheet.Cells(87, 17).Value = 0
rst.Close
cnn.Close
Set rst = Nothing
Set cnn = Nothing
End Sub
Here is what I have so far. Obviously this keeps passing the name of
the combobox in quotations. If someone could let me know what I'm
doing wrong it would make my life alot easier.
Private Sub Line1Type1_DropButtonClick()
Dim strlinenum1 As Variant
Dim strlinenum2 As String
strlinenum1 = line1type1.Name
strlinenum2 = line1type2
L1T1 strlinenum1
End Sub
Sub L1T1(strlinenum1 As Variant)
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim strsql As String
Dim strcb2 As String
strsql = "SELECT DISTINCT 'Electrical', 'none' from materials"
cnn.Open strcnn
rst.Open strsql, cnn, adOpenStatic
rst.MoveFirst
ActiveSheet.strlinenum1.List = Application.Transpose(rst.GetRows)
ActiveSheet.strlinenum1.Clear
ActiveSheet.line1type2.Clear
ActiveSheet.Cells(87, 17).Value = 0
rst.Close
cnn.Close
Set rst = Nothing
Set cnn = Nothing
End Sub