I have the following piece of code that returns data based on the value of ComboBox1
Combobox1 contains a list of numeric values that also include operators. the list is as follows:
<=100
<90
<80
<70
<60
Dim Rs As ADODB.Recordset
Set Rs = New ADODB.Recordset
Rs.Open "SELECT Table1.* FROM Table1 WHERE field1 '" & ComboBox1 & "'", Application.CurrentProject.Connection, adOpenDynamic, adLockOptimistic, adCmdText
textbox1 = Rs("Field1")
textbox2 = Rs("Field2")
textbox3 = Rs("Field3")
textbox4 = Rs("Field4")
textbox5 = Rs("Field5")
Rs.Close
when the code is run I am returning the data to textboxes within a form. The problem I have is
that only the first record is shown on the form, and I am unable to return all records in the format of
a continuous form. I am assuming that I must create some sort of loop using BOF and EOF to run through
records.
Your assistance will be most appreciated.
Regards
GC
Combobox1 contains a list of numeric values that also include operators. the list is as follows:
<=100
<90
<80
<70
<60
Dim Rs As ADODB.Recordset
Set Rs = New ADODB.Recordset
Rs.Open "SELECT Table1.* FROM Table1 WHERE field1 '" & ComboBox1 & "'", Application.CurrentProject.Connection, adOpenDynamic, adLockOptimistic, adCmdText
textbox1 = Rs("Field1")
textbox2 = Rs("Field2")
textbox3 = Rs("Field3")
textbox4 = Rs("Field4")
textbox5 = Rs("Field5")
Rs.Close
when the code is run I am returning the data to textboxes within a form. The problem I have is
that only the first record is shown on the form, and I am unable to return all records in the format of
a continuous form. I am assuming that I must create some sort of loop using BOF and EOF to run through
records.
Your assistance will be most appreciated.
Regards
GC