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

azhar2006

Registered User.
Local time
Today, 15:59
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: 29

arnelgp

..forever waiting... waiting for jellybean!
Local time
, 06:59
Joined
May 7, 2009
Messages
16,432
see the message.
 

Attachments

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

Gasman

Enthusiastic Amateur
Local time
Today, 23:59
Joined
Sep 21, 2011
Messages
10,568
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, 15:59
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
, 06:59
Joined
May 7, 2009
Messages
16,432
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, 15:59
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: 37
  • 2.PNG
    2.PNG
    36.5 KB · Views: 40

arnelgp

..forever waiting... waiting for jellybean!
Local time
, 06:59
Joined
May 7, 2009
Messages
16,432
bring your table tblmastr in design view and add Index (index name: Fullname) to field Fullname.
 

Users who are viewing this thread

Top Bottom