IWETHEY v. 0.3.0 | TODO
1,095 registered users | 1 active user | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Are all of those date parts from a single date?
That is, if you can derive qDOM, qMonth, qAPDay, qDOW, and qJDate from a single inputted date, then you're left with requesting only three params: qDate, qSystem, and qExcept.

The string-to-date coercion in Access is actually not too bad.

qDOM = Int(Format(CDate([Enter the report date]), 'd'))

etc.

It's doable. Personally, I'd move this kind of logic out of the database entirely and into a middle tier. ;)
New More
qDOM = Calendar day of month 1-31
qMonth = The month
qDOW = Alpha day of week (Sun ... Sat)
qJDate = Julian day
qAP = Day of the accounting period, based on a 28 day month. No correlation to actual calendar date.

Yes, I can generate the first three variable from a single date, and maybe the julian date, but I still need to pass to the query.

Other information that will be provided in number of days to run. That means that the query would be run x times to produce x schedules.

I've been doing it manually, but my co-workers are tech writers and I don't want to risk them missing a variable and not getting the schedules correct.

All for Disaster Recovery.

FWIW, I'm learning Access on the fly. All pointer are appreciated.

I'm trying Jay's VB suggestions and getting an error "Object Required" on the Set Query1 = line
New Sorry
To use the example code I gave you need to do this first. It's one of those things that is so standard I skipped by it. I should also point out that I don't have a copy of Access handy, so there could be typos and other things I've overlooked.

Set db = CurrentDb()

Despite the fact that all Access code exists in the context of a database, Access does not give you a reference to the database by default. Thus the above is usually the first line of non-declare code in any significant Access VB routine.

I believe the reason for that has to do with the fact that you can create multiple database variable and access multiple databases through them. But Access really should give you access to the database the code is in through some default keyword.

Jay
     How do I pass parameters to a Query in Access - (jbrabeck) - (12)
         Re: How do I pass parameters to a Query in Access - (JayMehaffey)
         For *very* simple stuff - (FuManChu) - (7)
             Here's the SQL code. - (jbrabeck) - (4)
                 Reformatting a bit - (ChrisR)
                 Are all of those date parts from a single date? - (FuManChu) - (2)
                     More - (jbrabeck) - (1)
                         Sorry - (JayMehaffey)
             Re: For *very* simple stuff - (andread) - (1)
                 Or "query by form" -NT - (mmoffitt)
         Found a way - (jbrabeck)
         Different approach is DoCmd.RunSQL - (rickw) - (1)
             How I've got it running - (jbrabeck)

That's some other guy with too much face above his eyes.
62 ms