btamsgn > 08-08-23, 03:37 PM
ongke0711 > 08-08-23, 04:06 PM
Sub toilui()
Dim sChi(12) As String
Dim i As Long, k As Long, j As Long
sChi(1) = "T" & ChrW(253)
sChi(2) = "S" & ChrW(7917) & "u"
sChi(3) = "D" & ChrW(7847) & "n"
sChi(4) = "M" & ChrW(227) & "o"
sChi(5) = "Th" & ChrW(236) & "n"
sChi(6) = "T" & ChrW(7883)
sChi(7) = "Ng" & ChrW(7885)
sChi(8) = "M" & ChrW(249) & "i"
sChi(9) = "Th" & ChrW(226) & "n"
sChi(10) = "D" & ChrW(7853) & "u"
sChi(11) = "Tu" & ChrW(7845) & "t"
sChi(12) = "H" & ChrW(7907) & "i"
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("Select * From Tbltoilui Order By Stt", dbOpenDynaset)
i = 7
j = 13
rs.MoveFirst
Do Until rs.EOF
rs.Edit
k = IIf(i Mod 12 = 0, 12, i Mod 12)
rs.Fields("chitoi").Value = sChi(k)
i = i + 1
k = IIf((j - 12) = 1, 1, j)
rs.Fields("chilui").Value = sChi(k)
j = j - 1
rs.Update
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
End Sub