You are here:
Advertisement
| Rating(1-10) | Knowledgeability = 10 | Clarity of Response = 10 | Politeness = 10 |
| Comment | Thank you for your help. My final code works a treat Dim db As Database Dim qry As QueryDef Dim SQLstr As String Set db = CurrentDb() Set qry = db.QueryDefs("qryDatasheetPrintPreview") If Not IsNull(Forms![frmEntries].[sfrmTransactions].Form.RecordSource) And Forms![frmEntries].[sfrmTransactions].Form.RecordSource <> "" Then SQLstr = "SELECT * FROM " & Forms![frmEntries].[sfrmTransactions].Form.RecordSource End If If Not IsNull(Forms![frmEntries].[sfrmTransactions].Form.Filter) And Forms![frmEntries].[sfrmTransactions].Form.Filter <> "" Then SQLstr = SQLstr & " where " & Forms![frmEntries].[sfrmTransactions].Form.Filter End If If Not IsNull(Forms![frmEntries].[sfrmTransactions].Form.OrderBy) And Forms![frmEntries].[sfrmTransactions].Form.OrderBy <> "" Then SQLstr = SQLstr & " order by " & Forms![frmEntries].[sfrmTransactions].Form.OrderBy End If qry.SQL = SQLstr DoCmd.OpenQuery "qryDatasheetPrintPreview", acViewNormal, acReadOnly Set qry = Nothing Set db = Nothing | ||
I can answer some questions on a wide variety of business applications, including MS Office, Lotus Smartsuite, Visio, Notes and many others.
I have over 16 years of experience as an IT professional, supporting a wide variety of business applications.

©2012 About.com, a part of The New York Times Company. All rights reserved.