use Loop in swap data from one table to another. (1 Viewer)

azhar2006

Registered User.
Local time
Today, 07:14
Joined
Feb 8, 2012
Messages
202
using Query is much faster than VBA.
but if you insist.
Good evening, my dear friend. The code worked great, but I have a problem with the message. Can I specify the message how many records have been updated?
Code:
MsgBox "You are about to update " & intCounter & " records."
'We need to loop through all of the records
'that our query object found
    While rs.EOF = False
 

Attachments

  • New Microsoft Access Database_2.zip
    33.5 KB · Views: 110

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:14
Joined
May 7, 2009
Messages
19,169
see the message.
 

Attachments

  • New Microsoft Access Database_2.zip
    32.1 KB · Views: 150

Gasman

Enthusiastic Amateur
Local time
Today, 14:14
Joined
Sep 21, 2011
Messages
14,042
PMFJI, but arnel has to sleep sometime :)

Use MoveLast and then check the RecordCount
Do not forget to MoveFirst before your loop.

Edit: Seems he does not? :)
 

azhar2006

Registered User.
Local time
Today, 07:14
Joined
Feb 8, 2012
Messages
202
PMFJI, but arnel has to sleep sometime :)

Use MoveLast and then check the RecordCount
Do not forget to MoveFirst before your loop.

Edit: Seems he does not? :)
Haha, sorry, I don't know the time with @arnelgp 🌷 , but I know that he is a good-hearted person. thank you all
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:14
Joined
May 7, 2009
Messages
19,169
you are using VBA, so everytime you press that button it will update the record (again)
even if you already updated it.
 

azhar2006

Registered User.
Local time
Today, 07:14
Joined
Feb 8, 2012
Messages
202
Hello my dear friend arnelgp I have encountered this error when I update the logs. I don't know what the problem is, I replaced the name field with a number field and also the same problem.
 

Attachments

  • 1.PNG
    1.PNG
    39.6 KB · Views: 124
  • 2.PNG
    2.PNG
    36.5 KB · Views: 131

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:14
Joined
May 7, 2009
Messages
19,169
bring your table tblmastr in design view and add Index (index name: Fullname) to field Fullname.
 

Users who are viewing this thread

Top Bottom