Using the below listed code to attempt to populate 30 combo boxes on form frmStart within Access 2000 VBA. Combo box names are numbered 1 thru 30 as are the Testers I am doing the search for. How do I correctly populate Combo box 1 with the results of the search for line on Tester 1.
Private Sub Form_Open(Cancel As Integer)
Dim stDocName, stLinkCriteria, SQLa As String: Dim T As Integer: T = 0
Dim cn As ADODB.Connection: Dim rs As ADODB.Recordset
Again:
T = T + 1
SQLa = "SELECT Line FROM VPD.dbo.vpd where Tester= " & T
Set cn = New ADODB.Connection: cn.Open "driver={SQL Server};" & _
"server=172.16.6.172;database=coilspec;uid=dtuttle;password=mpmadmin"
Set rs = cn.Execute(SQLa, , adCmdText)
[Forms]![frmStart]!T = rs.Fields("Line")
If (rs.EOF) Then rs.Close: cn.Close: Set rs = Nothing: Set cn = Nothing: DoCmd.Close: Exit Sub
GoTo Again:
End Sub
Private Sub Form_Open(Cancel As Integer)
Dim stDocName, stLinkCriteria, SQLa As String: Dim T As Integer: T = 0
Dim cn As ADODB.Connection: Dim rs As ADODB.Recordset
Again:
T = T + 1
SQLa = "SELECT Line FROM VPD.dbo.vpd where Tester= " & T
Set cn = New ADODB.Connection: cn.Open "driver={SQL Server};" & _
"server=172.16.6.172;database=coilspec;uid=dtuttle;password=mpmadmin"
Set rs = cn.Execute(SQLa, , adCmdText)
[Forms]![frmStart]!T = rs.Fields("Line")
If (rs.EOF) Then rs.Close: cn.Close: Set rs = Nothing: Set cn = Nothing: DoCmd.Close: Exit Sub
GoTo Again:
End Sub