Stuck in a sort of loop...

christheancient

Registered User.
Local time
Today, 04:07
Joined
Dec 28, 2002
Messages
41
My apologies if you already saw this loop. I seemed to be unsuccessful in attaching a copy of the file.

I am a comparative novice in Access 'serious' work and not much better at VB! I've currently got OfficeXP - but the attachment is in A97.

I found a nice little routine that allowed me to start playing with the ActiveX calendar. I was quite impressed.

In the course of trying to develop a database of use to me, I wanted to print reports based on start and finish dates and was doing fine using Activex calendars - until...

I got stuck on how to 'step back' to an earlier procedure when an end date of less that the start date was input.

Because I am such a noddy (there's quite a few hours work put in getting as far as I did), I would appreciate if any help that anyone can give is in extremely simple tems.

Many thanks in advance to those gurus out there that can probably do this stood on their head!

Chris
 

Attachments

ALMOST!

You just about had it!

1) compare 'Calendar2.value' to 'DateStart' - don't use 'DateEnd' since it hasn't been updated yet (it still has today's date in it)

2) don't assign the Msgbox to a variable, just have it prompt since you're not looking for the user's response other than 'OK'. Do this by getting rid of the parentheses around the arguments.

3) right after Msgbox, Exit Sub to avoid running the rest of your code

HTH,
John
 
John.

Very many, many thanks for your help.

IT WORKED!!

(Yes I know I'm shouting - I want to!)

As you say, so close. Just goes to show what looking at it too hard and long does to the eyes and brain.

Sorry for slight delay in responding. Der Boss needed me for something else for a while.

Well done, you've saved my sanity and what little hair I had left. :D
 
Glad to help - I haven't used CalendarControl at all, so was a good chance to try it out.

Der Boss has got you working on New Year's Day? Say it isn't so! :eek:

Well, I suppose some Calendar work is probably appropriate at the turn of a new year . . . that and fresh resolutions.

Cheers,
John
 
There are a couple of points, you display todays date on the form which I assume is for a reference only and therefore you don't need to store the value in a table, also what you're trying to do can be done with one calendar control and one button, here's a slightly altered copy.
 
Last edited:
Sorry to be a bit slow in catching up my thread, but work got in the way.

John...

Not so much that Der Boss had me working - more a case of keeping my cool by keeping out of my 17-year-old (going on 35) step-son's way. We don't always see eye-to-eye and if I hide in my "study/office", I don't lose my crust with him! The weather was too awful to do much else! I'm also sad in that I like trying to resolve ideas that occur to me!

Glad it gave you a chance with the calendar ActiveX. I did originally do it all with parameter queries, but I saw calendar used in another database for single date use and I just sort of rose to the challenge. The only way I'll learn.

Rich...

Thanks for another interesting solution. I did wonder if it was possible to do it as a single calendar routine, but never having seen the Me.CmdDate.Caption done before, I didn't know. Lived and learned another interesting trick here!

Strange as it may seem, I can, sort of, use the today's date bit in another routine that will record when the calendar function was actually used. I can have a fixed method of recording when reports - covering which dates - were generated.

To all that have worked and helped (or even had many thoughts about it) on my problem, I can only offer my sincerest thanks. It's people like you who can restore a bit of faith in humanity!

Chris
 

Users who are viewing this thread

Back
Top Bottom