Here is the deal. I would like to create my own vb function to use in the
experession builder in Access 2007. Is that possible? One I want to create is
to determine a week number. I know I can do this in the table but I am
working in a quiery.
Or maybe you can tell me how to enter criteria so that I can pull up records
for the previous week. I want to enter a salesID which will pull up sales in
the current week in one column and the previous week in another column. The
weeks are numerical values. week 1,2 etc. I have a field set up in my talbe
that has the week number but I'm having some sort of brain fart when in my
query I try to set the criteria for the week number as the current week
number -1. I tired referencing the table field and the query field by name
then -1 ie: [weeknum] -1 but this didn't succeed.
Once again thank you for your assistance,
To create a VBA Function, Press Alt-F11 to open the VBA development
environment. Create a new module, and add your function.
Other than that, you're not completely clear in your needs, but feel free to
provide more information. Especially table structure info.

Signature
Steve Clark,
Former Access MVP
FMS, Inc
http://www.fmsinc.com/consulting
> Here is the deal. I would like to create my own vb function to use in the
> experession builder in Access 2007. Is that possible? One I want to create is
[quoted text clipped - 10 lines]
> then -1 ie: [weeknum] -1 but this didn't succeed.
> Once again thank you for your assistance,
Beepa - 01 May 2008 19:25 GMT
Ty for you help. I was trying to create a function in a query that wasn't
listed. I didn't see a date function that produced a week number.
> To create a VBA Function, Press Alt-F11 to open the VBA development
> environment. Create a new module, and add your function.
[quoted text clipped - 16 lines]
> > then -1 ie: [weeknum] -1 but this didn't succeed.
> > Once again thank you for your assistance,
S.Clark - 01 May 2008 19:44 GMT
SELECT OrderDate, Format([OrderDate],"ww") AS TheWeek
FROM [Purchase Orders];

Signature
Steve Clark,
Former Access MVP
FMS, Inc
http://www.fmsinc.com/consulting
> Ty for you help. I was trying to create a function in a query that wasn't
> listed. I didn't see a date function that produced a week number.
[quoted text clipped - 19 lines]
> > > then -1 ie: [weeknum] -1 but this didn't succeed.
> > > Once again thank you for your assistance,