versuviusx
Registered User.
- Local time
- Today, 13:01
- Joined
- Nov 1, 2006
- Messages
- 15
ok this project is for a help desk. if a user has a problem with their computer they fill out a form and then send an email to the helpdesk guy being me.
i got it to work but i'm trying to make improvements.
basically i get an error that says" you can't reference a property or method for a control unless the control has focus"
basically i'm trying to create a string.
and i want to grab a value from a box that the user enters and make that value a string. then i want to insert that string into the StrTitle for the email.
the result should look like "help desk Support number: 23" in the email title.
i was thinking the syntax should look like
strTitle = "helpdesk Support" + "incident Number:" + strIncidentNumber
i tried making strIncidentNumber.text and that did not work. i can't figure it out. i'm really new at this but i would have thought my logic would have been correct. please let m know. i'd love to get this working.
this is what the code looks like:
Private Sub SendEmail_Click()
On Error GoTo Err_SendEmail_Click
Dim strIncidentNumber As String
Dim strCCName As String
Dim strTitle As String
Dim strMessage As String
strIncidentNumber= SupportNumberTxtBox.text
strCCName = "david@wrar.com"
strTitle = "helpdesk Support" + "incident Number:" + strIncidentNumber
strMessage = "please help i need help with this"
DoCmd.SendObject , , acFormatRTF, strCCName, _
, , strTitle, strMessage, False, False
Exit_SendEmail_Click:
Exit Sub
Err_SendEmail_Click:
MsgBox Err.Description
Resume Exit_SendEmail_Click
End Sub
i got it to work but i'm trying to make improvements.
basically i get an error that says" you can't reference a property or method for a control unless the control has focus"
basically i'm trying to create a string.
and i want to grab a value from a box that the user enters and make that value a string. then i want to insert that string into the StrTitle for the email.
the result should look like "help desk Support number: 23" in the email title.
i was thinking the syntax should look like
strTitle = "helpdesk Support" + "incident Number:" + strIncidentNumber
i tried making strIncidentNumber.text and that did not work. i can't figure it out. i'm really new at this but i would have thought my logic would have been correct. please let m know. i'd love to get this working.
this is what the code looks like:
Private Sub SendEmail_Click()
On Error GoTo Err_SendEmail_Click
Dim strIncidentNumber As String
Dim strCCName As String
Dim strTitle As String
Dim strMessage As String
strIncidentNumber= SupportNumberTxtBox.text
strCCName = "david@wrar.com"
strTitle = "helpdesk Support" + "incident Number:" + strIncidentNumber
strMessage = "please help i need help with this"
DoCmd.SendObject , , acFormatRTF, strCCName, _
, , strTitle, strMessage, False, False
Exit_SendEmail_Click:
Exit Sub
Err_SendEmail_Click:
MsgBox Err.Description
Resume Exit_SendEmail_Click
End Sub