?
Solved

loop error in Ms access vba

Posted on 2012-08-12
8
Medium Priority
?
863 Views
Last Modified: 2012-08-13
while running the following code i get error if it reach to end of the record

With Me.RecordsetClone
    .MoveFirst
    Do Until .EOF
       
        Call browser.FindElement("input text", "name=name").InputText(Forms!Form1!name9)
        Call browser.FindElement("input image", "id=startsearch").Click
       
        .MoveNext
   
         Me.Bookmark = .Bookmark
     
    Loop
    End With

can you help to fix this error
0
Comment
Question by:HKH1967
  • 4
  • 3
7 Comments
 
LVL 60

Accepted Solution

by:
Julian Hansen earned 2000 total points
ID: 38285136
The problem is the .MoveNext is hitting the end of file and then you are accessing .Bookmark.

Move it up as shown below - that should fix it.

With Me.RecordsetClone
    .MoveFirst
    Do Until .EOF
         Me.Bookmark = .Bookmark ' Move this here
       
        Call browser.FindElement("input text", "name=name").InputText(Forms!Form1!name9)
        Call browser.FindElement("input image", "id=startsearch").Click
       
        .MoveNext
   
     
    Loop
    End With

Open in new window

0
 

Author Comment

by:HKH1967
ID: 38285206
Great works fine thanks
0
 

Author Comment

by:HKH1967
ID: 38285234
I've requested that this question be closed as follows:

Accepted answer: 0 points for HKH1967's comment #a38285206

for the following reason:

Thanks
0
Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

 
LVL 60

Expert Comment

by:Julian Hansen
ID: 38285235
Ok but you need to assign points to a question.
0
 

Author Comment

by:HKH1967
ID: 38285294
sorry for that, thanks
0
 
LVL 60

Expert Comment

by:Julian Hansen
ID: 38285310
Np :) - did it myself earlier today
0
 

Author Closing Comment

by:HKH1967
ID: 38290006
accept the solution and assign full point 500
thanks
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

864 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