I'm trying to get the information from my recordset into a field on a report. It's almost working, that is of course, almost. In the details section of the report, it does display the last number in the record. But I'm wanting the field in the details section to display each and every record. For example, "SalesType" has 4 records, 1, 101, 200, and 203. Since 203 is the last record, that is what is displayed. What's wrong with my code here?
Dim salesNum As Integer
Dim Sales As Integer
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim strsql As String
strsql = "SELECT * FROM Sales"
cnn.Open CurrentProject.Connection
rst.Open strsql, cnn
Do While Not rst.EOF
Sales = rst.Fields("SalesType".Value
Me.listb.Value = "=" & Sales & ""
rst.MoveNext
Loop
Michael
Dim salesNum As Integer
Dim Sales As Integer
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim strsql As String
strsql = "SELECT * FROM Sales"
cnn.Open CurrentProject.Connection
rst.Open strsql, cnn
Do While Not rst.EOF
Sales = rst.Fields("SalesType".Value
Me.listb.Value = "=" & Sales & ""
rst.MoveNext
Loop
Michael