• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 447
  • Last Modified:

MoveNext doesn't seem to be going to the next record.

On my logging database, I am trying to do some more math figuring.  I have a MsgBox setup for error checking and come to find out it doesn't seem like the rst1.MoveNext is going to the next record.  hhmm.....

For each record I have a message pop up showing the "Tree Type".  You can see in the picture how there are 4 different tree types.  The record keeps showing "Gum" as the tree type instead of going on to "Blur Oak", then "Black Oak", etc.

Here is the initial SQL query showing that the ProjectID is correct.
SQL
Here is the MsgBox showing the Tree Type.  
Message boxDatabase1683--2-.accdb
0
getwidth28
Asked:
getwidth28
1 Solution
 
Rey Obrero (Capricorn1)Commented:
trying using

with me.recordset
do until .eof
msgbox "Tree Type = " & me.comboTreetype.column(1)

.movenext
loop
0
 
AielloJCommented:
getwidth28,

You may have to do a me.MoveFirst depending on the recordset type.

Best regards,

AielloJ


with me.recordset
me.movefirst
do until .eof
msgbox "Tree Type = " & me.comboTreetype.column(1)

.movenext
loop
0
 
mbizupCommented:
Your record set is working the way you think it should, and so is your MoveNext.

The problem is that this line is fixed on the current record in the form rather than referring to your recordset:

<< MsgBox "Tree Type =" & TreeType >>

To have it reflect the records within your recordset, you need to prefix it with rst1:

MsgBox "Tree Type =" & rst1!TreeType

Open in new window

0
 
getwidth28Author Commented:
Thank you everyone.  I was finally able to get back to trying some of these things.  As soon as I changed my MsBox to the above it went through the records like I was wanting it to.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now