Solved

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

Posted on 2013-11-18
4
427 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 119

Expert Comment

by:Rey Obrero
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now