D
Deleted member 162737
Guest
Greetings to everyone,
I'm new in VBA (also new member here) and I suppose that someone could help with this matter.
I have Table "Example" and Fields "ID", "A", "B" and "C":
A - Long Text - <Name>
B - Number - <Maximum number>
C - Number - <Current number>
Very simple Code in Module is:
Sub Example()
Dim MN As Integer
Dim CN As Integer
Dim I As Integer
CN = DLookup ("C", "Example", "ID=1")
MN = DLookup ("B", "Example", "ID=1")
For I = 1 To 3
TB = TB + 1
If TB > MB Then
MsgBox " STOP"
Else
MsgBox " Current number is " & CN
End If
CurrentDb.Execute "UPDATE Example SET C = CN WHERE ID = 1"
Next I
End Sub
QUESTION:
How can save data CN (current number) into into field C in table Example?
Thank you all in advance!
I'm new in VBA (also new member here) and I suppose that someone could help with this matter.
I have Table "Example" and Fields "ID", "A", "B" and "C":
A - Long Text - <Name>
B - Number - <Maximum number>
C - Number - <Current number>
Very simple Code in Module is:
Sub Example()
Dim MN As Integer
Dim CN As Integer
Dim I As Integer
CN = DLookup ("C", "Example", "ID=1")
MN = DLookup ("B", "Example", "ID=1")
For I = 1 To 3
TB = TB + 1
If TB > MB Then
MsgBox " STOP"
Else
MsgBox " Current number is " & CN
End If
CurrentDb.Execute "UPDATE Example SET C = CN WHERE ID = 1"
Next I
End Sub
QUESTION:
How can save data CN (current number) into into field C in table Example?
Thank you all in advance!