All,
I am having a nightmare with the following piece of code.
Me.Dialog.SetFocus
Me.Dialog.SelStart = 0
Me.Dialog.SelLength = Len(Me.Dialog)
DoCmd.RunCommand acCmdCopy
When it executes the last line (DoCmd.RunCommand acCmdCopy), instead of copying the text select from the control "Dialog" on my form, it copies the object which is selected in the database window! i.e. if tblFiles is selected in the db window it pastes the contents of the table to my excell workbook. If a form is selected in the db window the program fails when attempting to paste to excell.
I thought it may have been because the form was not set to Modal, but this was not the case.
The annoying thing is, I had this working perfectly only yesterday, and now I can't seem to re-trace my steps to see whats changed.
Any help would be gratfully recieved
Cheers
I am having a nightmare with the following piece of code.
Me.Dialog.SetFocus
Me.Dialog.SelStart = 0
Me.Dialog.SelLength = Len(Me.Dialog)
DoCmd.RunCommand acCmdCopy
When it executes the last line (DoCmd.RunCommand acCmdCopy), instead of copying the text select from the control "Dialog" on my form, it copies the object which is selected in the database window! i.e. if tblFiles is selected in the db window it pastes the contents of the table to my excell workbook. If a form is selected in the db window the program fails when attempting to paste to excell.
I thought it may have been because the form was not set to Modal, but this was not the case.
The annoying thing is, I had this working perfectly only yesterday, and now I can't seem to re-trace my steps to see whats changed.
Any help would be gratfully recieved
Cheers