Tim Bedborough
Registered User.
- Local time
- Today, 12:59
- Joined
- Nov 16, 2015
- Messages
- 42
Hi all
Got myself a bit stuck and possibly not starting in the right place to begin with !
Using Access 16
I want to use code to automate a copy and paste process. Copy from 2 controls/fields/Text Boxes on 1 form (frmEmail [Details] and [Body]) and paste into a single control in subfrmActivityDateOrder [Details].
I have managed to copy and paste OK but unable to make a character space between the first and second paste (so it all runs into 1 long sentence).
Happy to show all code for complete Private Sub but this is the bit I have got to where SelStart is being used (possibly not in the right way).
Any pointers much appreciated to achieve [Details] SPACE [Body].
'Copy and paste the email subject line into job card activity details
'If there is no data in the subject line prompt user to put one in
Forms.frmEmail.SetFocus
DoCmd.GoToControl "Subject"
If IsNull(Me.Subject) = False Then
DoCmd.RunCommand acCmdCopy
Forms.frmjobs.SetFocus
DoCmd.GoToControl "Details"
DoCmd.RunCommand acCmdPaste
Else
Forms![frmjobs]![subfrmActivityDateOrder].Form![Details] = "Give this activity a title"
End If
'Copy and paste the email body into job card activity details
'There should be some reference to the subject line (from the code above) followed by the pasted body of the email
Forms.frmEmail.SetFocus
DoCmd.GoToControl "Body"
DoCmd.RunCommand acCmdCopy
Forms.frmjobs.SetFocus
DoCmd.GoToControl "Details"
SelStart = Len(Details) 'Select the starting point for the cursor at the end of the [Details] text
DoCmd.RunCommand acCmdPaste
Got myself a bit stuck and possibly not starting in the right place to begin with !
Using Access 16
I want to use code to automate a copy and paste process. Copy from 2 controls/fields/Text Boxes on 1 form (frmEmail [Details] and [Body]) and paste into a single control in subfrmActivityDateOrder [Details].
I have managed to copy and paste OK but unable to make a character space between the first and second paste (so it all runs into 1 long sentence).
Happy to show all code for complete Private Sub but this is the bit I have got to where SelStart is being used (possibly not in the right way).
Any pointers much appreciated to achieve [Details] SPACE [Body].
'Copy and paste the email subject line into job card activity details
'If there is no data in the subject line prompt user to put one in
Forms.frmEmail.SetFocus
DoCmd.GoToControl "Subject"
If IsNull(Me.Subject) = False Then
DoCmd.RunCommand acCmdCopy
Forms.frmjobs.SetFocus
DoCmd.GoToControl "Details"
DoCmd.RunCommand acCmdPaste
Else
Forms![frmjobs]![subfrmActivityDateOrder].Form![Details] = "Give this activity a title"
End If
'Copy and paste the email body into job card activity details
'There should be some reference to the subject line (from the code above) followed by the pasted body of the email
Forms.frmEmail.SetFocus
DoCmd.GoToControl "Body"
DoCmd.RunCommand acCmdCopy
Forms.frmjobs.SetFocus
DoCmd.GoToControl "Details"
SelStart = Len(Details) 'Select the starting point for the cursor at the end of the [Details] text
DoCmd.RunCommand acCmdPaste