Solved

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

Posted on 2013-11-18
4
432 Views
Last Modified: 2013-11-18
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
Comment
Question by:getwidth28
4 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39656648
trying using

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

.movenext
loop
0
 
LVL 13

Expert Comment

by:AielloJ
ID: 39657166
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
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 39657304
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
 

Author Comment

by:getwidth28
ID: 39657332
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question