Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calander 1

Status
Not open for further replies.

Drol

Instructor
Mar 13, 2002
25
0
0
GB
I have a database i have inherited from another individual. I'm trying to 'fix' it. All I want is the Calendar in the database to show the current day/date when the batabase is opened. It shouldn't be difficult, should it?

I've looked in the proerties and even dabbled with VB, but to no avail.[sadeyes]
 
Yep That worked, however i cannot now navigate to another date when its open, is there another command that will allow this?
 
delete the control source value
in the "Other" properties tab find the ValueIsNull property make sure it is set to No
(I have a feeling it is set to yes)
Now when the form opens it should be set to the current date and you can select a different date (which will be reflected dynamically in the value property of the control)
JHall
 
Try putting this in the On Current:

Forms![formname]![controlname].Today


it sets the control to todays date
 
No I must be missing something here, with all this help I still can't do it.

Drol
 
Explain what you have done so far to this point. Please, I would rather have too many details, than not enuf.
 
OK, All I have done so far is played with properties,

I set the Control to '=Date()' and ValueIsNull to 'No'. That did then open the calander on the present date, but the calader was inactive. When you say put in the On Current
I assume thats VB, I am only a begginner on that and it went above my head!



 
ok, leave the control source blank, do not set it to '=Date()'.... better yet... My best advice here is to delete the calendar control and then add a new calendar control in it's place, so that everything is set to it's default (just to make sure nothing was changed)

Once you have the new control made go to the properties of the entire form (make sure the properties box title says FORM. Then goto the EVENT tab on the properties box. It should show a box titled 'On Current' When you select 'On Current" a button with 3 periods (...) should show up. Press that button. Access will then ask you to Choose Builder. Select 'Expression Builder' then press 'OK'.

When the Expression Builder box pops up, type in:

Forms![formname]![controlname].Today

Make sure you change the formname to the name of the form, and controlname to the calendar controls name. (FYI, leave the brakets [] around the names.)
 
If this is a records based form then each change of record either through navigation or tabs will cause the control to set to the current date. If you later decide to bind this control to your data then this could have serious unintended consequences. If you set the properties as I described in my last few posts then you will get an initial default value of current date and you will be able to change the date. JHall
 
jhall,
I agree that if the control is bound to the data, then tabing through the controls will change the data. But your way does the same thing, does it not?
 
Nope. I think maybe I didn't make myself clear. After the post where I said to put the control source =Date() I meant to show a completely different approach that would allow for the changing of the value. Read the posts following that one and you'll see what I mean. With that method when not bound if you change the date it stays that way until you change it again regardless of the record. JHall
 
Well after much cussing and key bashing I have finally sorted the problem, thanks to you all, but GeekinGlasses had the right solution. Thanks very much. Its a heck of a way to learn!!!

Drol
 
jhall,

Oh, I re-read your posts and your right. I've just always found it best to code in the date to equal a value when the control is unbound. I've had problems with access assigning the current date with older versions of the calendar control.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top