[AccessD] custom sorts/groups in a report

Harry Coenen pharryecoenen at btinternet.com
Tue Apr 20 16:16:42 CDT 2004


Hi Susan

VbUseSystem
My object browser shows:
Const vbUseSystem = 0
    Member of VBA.VbFirstWeekOfYear
Use the day of the week specified in your system settings for the first day
of the week.

Const vbUseSystemDayOfWeek = 0
    Member of VBA.VbDayOfWeek
Use NLS API setting

the descriptions are from the helpfile address:
VbLR6.chm::/html/vamscDateConstants.htm
titled: Date Constants
(XP version)

I suppose in both cases the value will be derived from the systems settings
in the machines registry


Report Error
I usually hide all reports and run them from forms, especially because the
subsets of data the user wants depend on selections made in the forms. Then
I pass the selections to the report and trap the errors. e.g. no data.


Picky?
Users don't read manuals, only their lawyers will do so when you really make
a mess.
So guiding users through the appropriate process with menus, tooltips,
messages, etc. isn't picky, just good service.


Regards

Harry


--

>-----Original Message-----
>From: accessd-bounces at databaseadvisors.com 
>[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of 
>Susan Harkins
>Sent: Tuesday, April 20, 2004 9:49 PM
>To: 'Access Developers discussion and problem solving'
>Subject: RE: [AccessD] custom sorts/groups in a report
>
>
>If the expression's in the query and you open the report 
>without specifying
>the value in the form, how would you prevent an error in the 
>form? I suppose
>I could just handle it and remind the user to open the form 
>and choose the
>first day of the week. 
>
>Right now, I've set the report to default to a value and since the
>expression's in the report, it works whether you start from 
>the form or just
>open the report. You can't specify the grouping value when you open the
>report that way, but at least there's no error -- which is a nice
>alternative especially if the first day of the week seldom 
>changes. That way
>the user's not forced to go through the form every time. 
>
>I realize I sound really picky -- but these are the sort of nitpicky
>problems I get from readers. These solutions have to be as universal as
>possible or I get email. :) "It won't work if...." even when 
>I've told them
>clearly in the article that it won't work if... but somehow 
>it's still the
>article's shortcoming. It's always best if I can head them off. 
>
>Which reminds me -- can someone explain the vbUseSystem 
>constant? There's
>almost nothing about it on msdn. It's a system default, but 
>there's not much
>about it. Well, the serious search-challenged was unable to 
>find anything on
>it besides a vague reference -- no real explanation of the 
>consequences.
>
>Susan H. 
>
>Hi Susan
>
>In the query you can pick the value from the form as an expression:
>
>  Select
>    ...,
>    [Forms].[frmSomeForm].[txtTextbox] As FirstDayOfWeek
>  From
>    ...
>
>Is is recommendable also to specify this as a parameter to avoid type
>mismatch errors, indeed if the textbox is unbound:
>
>  Parameters [Forms].[frmSomeForm].[txtTextbox] Byte;
>
>I don't know what your module does, but basically the date of 
>the first day
>of the week of datDate can be found from this formula:
>
>  DateWeekFirst =
>    DateAdd("d", vbSunday - WeekDay(datDate, FirstDayOfWeek), datDate)
>
>You would need to replace vbSunday with the actual value (1 for A97).
>    
>End Function
>
>/gustav
>
>
>> Let me rephrase that -- if I have to have a module, I don't think I 
>> really care what gets passed where -- my hope was to eliminate the 
>> module and do all the calculating in the query or the report and I 
>> thought I might be able to bypass the module using the openargs 
>> argument. Replacing the module I have for one that passes 
>the value to 
>> a query really doesn't resolve the issue I had.
>
>> Susan H. 
>
>> That's what I'd like to do -- and may do yet  by passing the 
>> firstdayofweek value from the form to the query instead of 
>the report. 
>> Truth is, I don't know how -- I can't remember ever passing 
>a value to 
>> a query before and a parameter query is out.
>
>--
>_______________________________________________
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com
>
>-- 
>_______________________________________________
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com
>




More information about the AccessD mailing list