473,379 Members | 1,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

vba function movenext does not work

Hi,

I have written a code to display records from the ms access table on a form using text boxes, combos. When I execute the rs.movenext command ideally it should move to the next record in the table and display the same which is not happening

Here is the code

rs1.MoveFirst

While Not rs1.EOF
Text1 = rs1.Fields(0)
DTPicker0.Value = rs1.Fields(1)
Text4 = rs1.Fields(2)
Text6 = rs1.Fields(3)
Text8 = rs1.Fields(4)
rs1.MoveNext
Wend

Can some body help me in this
Aug 7 '07 #1
4 7439
missinglinq
3,532 Expert 2GB
I see nothing wrong with the code you've posted, but we really need to see the rest of the code that goes with this, i.e. the code for entire sub/event. We aso need to know how you're displaying this retrieved data.

Welcome to TheScripts!

Linq ;0)>
Aug 7 '07 #2
ADezii
8,834 Expert 8TB
Hi,

I have written a code to display records from the ms access table on a form using text boxes, combos. When I execute the rs.movenext command ideally it should move to the next record in the table and display the same which is not happening

Here is the code

rs1.MoveFirst

Expand|Select|Wrap|Line Numbers
  1. While Not rs1.EOF
  2.   Text1 = rs1.Fields(0)
  3.   DTPicker0.Value = rs1.Fields(1)
  4.   Text4 = rs1.Fields(2)
  5.   Text6 = rs1.Fields(3)
  6.   Text8 = rs1.Fields(4)
  7.     rs1.MoveNext
  8. Wend
Can some body help me in this
How are 'you' executing a Recordset MoveNext while it is contained within a Loop? As soon as the code is executed, you will instantly be at the Last Record in the Recordset and the Text Boxes and DTPicker Control will display the appropriate values from this Last Record. Are you sure that you are not referring to the manual navigation (MoveNext) through a Form's Records via DoCmd.GoToRecord , , acNext?
Aug 8 '07 #3
missinglinq
3,532 Expert 2GB
That's why I asked how he was displaying the retrieved data! If you put a messagebox in just before the MoveNext statement you can step thru the records one at a time, but without that they zip thru just like you said. Of course, we don't know that the recordset has been set up correctly since we haven't seen that part of the code.

Linq ;0)>
Aug 8 '07 #4
ADezii
8,834 Expert 8TB
That's why I asked how he was displaying the retrieved data! If you put a messagebox in just before the MoveNext statement you can step thru the records one at a time, but without that they zip thru just like you said. Of course, we don't know that the recordset has been set up correctly since we haven't seen that part of the code.

Linq ;0)>
We'll just have to wait and see as always.
Aug 8 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: JP SIngh | last post by:
Thanks to Manohar for writing the basic code for displaying the managers and the employees in a tree like structure. I have adapted the code below but it gives me an error "exception occcured"...
9
by: JP SIngh | last post by:
Hi All I am trying to write a recursive function to list the managers and his employees in a tree like sctructure Manager 1 Emp1 Emp1.1 Emp 1.2 Emp 2
2
by: Steven Burn | last post by:
..:: The Specs: MS Access 2000 (host charges extra for SQL/MySQL) MS Windows Server 2003 (prod) / MS XP SP1 (dev) ..:: The setup: The database has been setup with two tables; tblDownloads
2
by: Jim Lewis | last post by:
After everything I have read and some of my own testing I am convinced that XPathDocument are more efficient if you are only using XML for read only and not modifying the XML. However, I have been...
2
by: Jozef | last post by:
Hello, I'm trying to create a central function that runs a connection to an SQL Server database. The connection etc works, but when I try to call it, I get an error saying "Runtime-Error 91:...
2
by: ThurstonHowl | last post by:
Hello, my task is the following: Input are tables with fields containing strings where the strings are actually delimited lists. For example, one field could contain 'AB|CD|EF|GH' I've...
11
by: Geagleeye | last post by:
Hi, Im a rookie in vba, and therefor got a problem. i do have folwing records F G --------------- 2 3 2 5 6 7
11
by: The Frog | last post by:
Hi all, Maybe I am just missing something simple here, but I seem to have an issue with a callback function in A97 that is used to fill a Listbox with values. The first time the callback...
1
by: darrel | last post by:
Hello, i need you help, can someone whats the cause of getting an error of Expected function or variable, its like this i have a function code in a module and call it on my main form.. here my code:...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.