Hello,
I am learning how to use VBA after playing with macros for a while. A brief description for what I'm attempting to do: I have a case management system which needs a comment box to show historic actions from various employees on different cases. Each comment needs to ONLY display on the relevant case alongside the commenting employees name and the date/time stamp.
EG:
Joe Smith 30/01/2017 12:00:00
Thank you for your update John.
John Smith 30/01/2017 11:57:12
This is a comment for case 1.
BUT it is very important that case 1 only displays case 1 comments, case 2 only displays case 2 comments and so on...
So far I have had a go at trying to do this, you'll have to excuse my poor attempt, I pretty much have no idea what I am doing! Below is some code on my add comment button.
This doesn't work at all, I get an error when it tried to set the textbox content as a parameter... Can anyone advise how I go about doing what I need to do?
I am learning how to use VBA after playing with macros for a while. A brief description for what I'm attempting to do: I have a case management system which needs a comment box to show historic actions from various employees on different cases. Each comment needs to ONLY display on the relevant case alongside the commenting employees name and the date/time stamp.
EG:
Joe Smith 30/01/2017 12:00:00
Thank you for your update John.
John Smith 30/01/2017 11:57:12
This is a comment for case 1.
BUT it is very important that case 1 only displays case 1 comments, case 2 only displays case 2 comments and so on...
So far I have had a go at trying to do this, you'll have to excuse my poor attempt, I pretty much have no idea what I am doing! Below is some code on my add comment button.
Code:
Private Sub CM_cmdAddComment_Click()
If IsNull(Me.CM_txtComment) Then
MsgBox "Please enter a comment in the box provided", vbExclamation, "Error 011"
Else
DoCmd.SetParameter "prmCaseReference", CaseID
DoCmd.SetParameter "prmComment", CM_txtComment
DoCmd.SetParameter "prmOfficerReference", Forms!Homepage.HP_txtCurrentID
DoCmd.RunDataMacro "tblComments.AddComment"
End If
End Sub
This doesn't work at all, I get an error when it tried to set the textbox content as a parameter... Can anyone advise how I go about doing what I need to do?