I am very new to VBA for Access 2013. Thank you in advance for your assistance.
I have one simple table with three fields, Auto #; txtComment and txtNewComment.
I designed a form with the two fields, txtComment and txtNewComment and a control button cmdAppendComment and the caption "Append Comment"
I have the following code:
Private Sub cmdAppendComment_Click()
If (IsNull(txtNewComment.Value)) Then
MsgBox ("Please enter a comment before clicking on the Append Comment button.")
Exit Sub
End If
If (IsNull(txtComment.Value)) Then
txtComment.Value = txtNewComment.Value & " ~ " & VBA.DateTime.Date & " ~ " & VBA.DateTime.Time
Else
txt.Comment.Value = txtComment.Value & vbNewLine & vbNewLine & txtNewComment.Value & " ~ " & VBA.DateTime.Date & " ~ " & VBA.DateTime.Time
End If
txtNewComment.Value = ""
End Sub
I enter the first new comment and it updates the Comment field with the time and date stamp.
I attempt to enter the second comment and I receive an error: Run-time error '424' Object required.
What am I missing. I found this code on an Access forum and wanted to attempt to duplicate for the sake of learning...I am sure it is simple but would appreciate the help.
Thank You!