?
Solved

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

Posted on 2013-11-18
4
Medium Priority
?
436 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 2000 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

764 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