use Loop in swap data from one table to another. (2 Viewers)

azhar2006

Registered User.
Local time
Today, 07:54
Joined
Feb 8, 2012
Messages
180
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: 10

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:54
Joined
May 7, 2009
Messages
15,037
see the message.
 

Attachments

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

Gasman

Enthusiastic Amateur
Local time
Today, 15:54
Joined
Sep 21, 2011
Messages
9,589
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:54
Joined
Feb 8, 2012
Messages
180
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, 23:54
Joined
May 7, 2009
Messages
15,037
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:54
Joined
Feb 8, 2012
Messages
180
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: 18
  • 2.PNG
    2.PNG
    36.5 KB · Views: 20

arnelgp

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

Users who are viewing this thread

Top Bottom