Solved

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

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

Technology Partners: 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!

Question has a verified solution.

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

Suggested Solutions

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Familiarize people with the process of utilizing SQL Server functions 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 Microsoft Ac…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

739 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