I am setting up a print command button but I am not sure I am referring to the sub controls correctly. The way it is setup I have my main form (frmMainMenu) and on it I have a subform called sfrmMessageMain on which is another subform called sfrmMessageSearch.
Here is my print code:
Private Sub cmdPrint_Messages_Click()
If Me.txtMessages_OrderBy = "qrySearch_Messages." Then
Forms![frmMainMenu].[sfrmMessageMain].[sfrmMessageSearch].Form.OrderBy = "qrySearch_Messages.ActivityDate DESC"
Forms![frmMainMenu].[sfrmMessageMain].[sfrmMessageSearch].Form.OrderByOn = True
End If
If Forms![frmMainMenu].[sfrmMessageMain].[sfrmMessageSearch].Form.FilterOn And Len(Forms![frmMainMenu].[sfrmMessageMain].[sfrmMessageSearch].Form.Filter & "") > 0 Then
DoCmd.OpenReport "Messages", acViewPreview, , Me.sfrmMessageSearch.Form.Filter
DoEvents
DoCmd.RunCommand acCmdZoom100
Else
DoCmd.OpenReport "Messages", acViewPreview
DoEvents
DoCmd.RunCommand acCmdZoom100
End If
End Sub
When I run it I get Object does not support this property or method and in debug mode it highlights
Forms![frmMainMenu].[sfrmMessageMain].[sfrmMessageSearch].Form.OrderBy = "qrySearch_Messages.ActivityDate DESC"
Any ideas?
Thank you,
Art Lorenizni
Sioux Falls, SD
Posted by: dbalorenzini@yahoo.com
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (1) |
Tidak ada komentar:
Posting Komentar