I have a question (that's why I'm here actually :P ) about VBA @ MS Access.
So, I have a huge database (well, for me it is huge, about 23K+ ID) on shoes. It has 5 columns: ID, Article number, size (mm),pairs (avaliable on stock) and EAC13 codes. It is updated daily. Everyday I get the update on it, on CSV (all those ID all over again) and create new tables, although I just need to update stock availability. However there is one column that I have to change in order to get reports: Sizes. I have to get 2 reports, one where I get the size of the shoe in mm and the other where the size is on European measure. For example: 245 mm is equal to a 35. Simple as that. I have a VBA that I thought it could help me to replace all those values (yes, all the 23k on the "size" column), that goes like this
Public Sub Substitui() Dim db As DAO.Database Dim rst As DAO.Recordset Dim fld As DAO.Field Dim strSQL As String Set db = CurrentDb() strSQL = "SELECT * FROM BS_2704" Set rst = db.OpenRecordset(strSQL, dbOpenDynaset) rst.MoveFirst Do Until rst.EOF For Each fld In rst.Fields If fld.Value = "150" Then rst.Edit fld.Value = "24" rst.Update End If If fld.Value = "160" Then rst.Edit fld.Value = "25" rst.Update End If (...) If fld.Value = "325" Then rst.Edit fld.Value = "50" rst.Update End If Next fld rst.MoveNext Loop rst.Close Set rst = Nothing End Sub
Anyway...this only changes 150 entries (more or less). The million dollar question is, is there any kind of line that I am missing here in order to get this VBA to change ALL the 23k entries?
I am a n00b on this fields, so I would appreciate some n00b therms for a start. Thanks for the patience.