[AccessD] custom sorts/groups in a report

Susan Harkins ssharkins at bellsouth.net
Tue Apr 20 15:22:34 CDT 2004


 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Tuesday, April 20, 2004 2:59 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] custom sorts/groups in a report

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




More information about the AccessD mailing list