I don't seem to be able to get opening a report and sortin the rcords right.
I an open the report, limited to a range of my choosing. So, for example
the code below opens my report and limits it to the dates required.
DoCmd.OpenReport stDocName, acPreview, "[NegBehave].[NegDate] Between #" &
Format(startdate, "DD MMM YYYY") _
& "# and #" & Format(enddate, "DD MMM YYYY") & "#"
The start date and end date are chosen by the user.
All is fine, but I wan to offer the user the opportunity to sort and print
in any order. I feel I ought to be able to tack on the end of this Orber By
FieldX, but nothing seem to work. 1 5045
"JohnM" <jo**@jmawer.demon.co.uk> wrote in message
news:di*******************@news.demon.co.uk... I don't seem to be able to get opening a report and sortin the rcords
right. I an open the report, limited to a range of my choosing. So, for example the code below opens my report and limits it to the dates required.
DoCmd.OpenReport stDocName, acPreview, "[NegBehave].[NegDate] Between #" & Format(startdate, "DD MMM YYYY") _ & "# and #" & Format(enddate, "DD MMM YYYY") & "#"
The start date and end date are chosen by the user.
All is fine, but I wan to offer the user the opportunity to sort and print in any order. I feel I ought to be able to tack on the end of this Orber
By FieldX, but nothing seem to work.
In the OPEN event of your report put code similar to this:
(CAUTION: air code)
Select Case Forms!MyForm!SortOrder
Case 1
Me.OrderBy = "Date1, Account, Lname"
Me.OrderByOn = True
Case 2
Me.OrderBy = "Account, Date1, Lname"
Me.OrderByOn = True
Case 3
Me.OrderBy = "Lname, Account, Date1"
Me.OrderByOn = True
End Select
Good Luck,
Fred Zuckerman This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Andrew |
last post by:
Hi All:
I am using Access2000 and I find that the command to open an Access report
in preview mode is very slow: DoCmd.OpenReport rptABC, acViewPreview, "",
""
The scenario is this:
- The...
|
by: Jonathan Goldman |
last post by:
Hi-
I have a relatively simple report that I open in an Access '97 VBA
procedure, using the
Docmd.OpenReport "rptName", acViewNormal
syntax. The problem is that doing this usually crashes...
|
by: Filips Benoit |
last post by:
Dear All,
DoCmd.OpenReport RPT_TEST, A_PREVIEW, QueryAsFilter doesn't work correctly
in A97 but works OK in A2K.
Is this a bug for A97 ?
Filip
|
by: LoopyNZ |
last post by:
Hi there,
I've converted an Access 97 front end to Access 2000, but when I try to
run a VBA DoCmd.OpenReport (e.g. DoCmd.OpenReport
"rpt_programme_listing") line, Access completely crashes...
|
by: news.onet.pl |
last post by:
Hello!
I have a question concerning to open the reports.
I know that DoCmd.OpenReport is a obsolete form of opening the reports, but
how to implement opening reports in VB using another VB code?...
|
by: enough2Bdangerous |
last post by:
access runtime error 3011 on docmd.openreport
--------------------------------------------------------------------------------
Access database (file format 2002-2003) generates reports with...
|
by: Simon |
last post by:
Dear reader,
The syntax for Docmd.OpenReport is:
OpenReport(ReportName, View, FilterName, WhereCondition, WindowMode,
OpenArgs)
Example
The following example prints Sales Report while...
|
by: robtyketto |
last post by:
Greetings,
I originally used a button on a from created via the button wizard (access 2007) to run my report which was based on a query.
Since I wanted to add some validation I removed the...
|
by: scottbouley |
last post by:
Maybe I'm missing something or perhaps there's another way to do this. I'm trying to allow the user to preview and print an invoice as they are exiting from the New Sale form. However, the preview...
|
by: gazza10001 |
last post by:
Hi
i hope you can help my company uses access and has modified for its needs usually what happens is you serach for the invoice by its number and then it brings all the information up such as...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |