update number of record with combolist

Bader

New member
Local time
Today, 05:23
Joined
Jan 20, 2014
Messages
5
I want to creat an update query

to update 20 record with the first item in combolist then the next 20 record updated with the second item in list
 
Bader,

I have no idea why you need it, but this should do it.

Code:
Dim rst As DAO.RecordSet
Set rst = CurrentDb.OpenRecordset("Select * from YourTable")
While not rst.EOF and Not rst.BOF
   rst.Edit
   rst!YourField = Me.YourListBox.ItemData(Int(rst.AbsolutePosition/20))
   rst.Update
   rst.MoveNext
   Wend

Wayne
 
Bader,

I have no idea why you need it, but this should do it.

Code:
Dim rst As DAO.RecordSet
Set rst = CurrentDb.OpenRecordset("Select * from YourTable")
While not rst.EOF and Not rst.BOF
   rst.Edit
   rst!YourField = Me.YourListBox.ItemData(Int(rst.AbsolutePosition/20))
   rst.Update
   rst.MoveNext
   Wend

Wayne
Thank you very much
 

Users who are viewing this thread

Back
Top Bottom