Selasa, 06 Juni 2017

[MS_AccessPros] Refering to subcontrols

 

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)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar