Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / March 2008

Tip: Looking for answers? Try searching our database.

Calculate in report or Query?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sam - 31 Mar 2008 13:28 GMT
I'm using the following to show a day of the week alongside the date in a
report. I am wondering if this should be done in the report or done in the
query... maybe even a function to return the answer to the query? Any
opinions on the best way to do it?

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim DOW As String
Select Case Weekday(txtDemoDt)
Case 1
DOW = "Sun"
Case 2
DOW = "Mon"
Case 3
DOW = "Tue"
Case 4
DOW = "Wed"
Case 5
DOW = "Thu"
Case 6
DOW = "Fri"
Case 7
DOW = "Sat"
End Select
Me.txtDOW = DOW
   
End Sub
Signature

Thanks

Rob Parker - 31 Mar 2008 13:32 GMT
I'd do it as a calculated field in the report's recordsource query.  But I'm
open to better advice from the multitude of MVPs ;-)

Rob

> I'm using the following to show a day of the week alongside the date in a
> report. I am wondering if this should be done in the report or done in the
[quoted text clipped - 22 lines]
>
> End Sub
Allen Browne - 31 Mar 2008 13:34 GMT
Instead of writing code, you could just add another text box with these
properties:
   Control Source        =[txtDemoDt]
   Format                   ddd

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> I'm using the following to show a day of the week alongside the date in a
> report. I am wondering if this should be done in the report or done in the
[quoted text clipped - 22 lines]
>
> End Sub
sam - 31 Mar 2008 13:46 GMT
Thanks Allen. If there is a complicated or long winded way to do something I
can usually find it. Your idea looks a much better option
Signature

Thanks

> Instead of writing code, you could just add another text box with these
> properties:
[quoted text clipped - 27 lines]
> >
> > End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.