Date Default

G

Guest

We use an OLE called DtPicker.

It is always defaulting to Oct 18, 2005 (the start date of using Access).
How can I make it default to todays date?
 
A

Albert D. Kallal

In your forms on-load event, simply set hte value.


me.ctlMyDate.Value = date
 
G

Guest

OK but then do I need to creat a macro where the date is specified?

I put it in and got a message that the macro does not exist.

Foregive my inexperience on this - I am a relatively new user.

(go oilers go eskis)
 
A

Albert D. Kallal

the actual steps would be:

open the form in design mode.

Select the form

edit->select form

Now, display the properties sheet for the form (if not displayed already)

view->properties

Now, click on the properties sheet "events" tab

click on the "on load" event to highlight that option.

Note to the right...you see a button appear with ... dots...it looks like
[...]

Click on this button...you usually get 3 choices

choose code....

Now, in the code editor, type in your code

me.NameOfCalendarContorlgoesHere.Value = date

That is it....one line of code....

You of couse change the above contorl name to what you used for the
contorl....
 
G

Guest

OK - the control is the data field name right?

So what if I have 6 different date fields on this form?

Need Date
Ready Date
Arrived Date
Completion Date
Termination Date
 
G

Guest

GOT IT!!!!!

Aplied the code editor to each date under "On Goto Focus"

Thanks
--
A MACKENZIE, CMA, MBA


aMack said:
OK - the control is the data field name right?

So what if I have 6 different date fields on this form?

Need Date
Ready Date
Arrived Date
Completion Date
Termination Date

--
A MACKENZIE, CMA, MBA


Albert D. Kallal said:
the actual steps would be:

open the form in design mode.

Select the form

edit->select form

Now, display the properties sheet for the form (if not displayed already)

view->properties

Now, click on the properties sheet "events" tab

click on the "on load" event to highlight that option.

Note to the right...you see a button appear with ... dots...it looks like
[...]

Click on this button...you usually get 3 choices

choose code....

Now, in the code editor, type in your code

me.NameOfCalendarContorlgoesHere.Value = date

That is it....one line of code....

You of couse change the above contorl name to what you used for the
contorl....
 
G

Guest

Seems to work but not always.

On some users pc's we get a Compile Error: the "Date" is highlighted and the
error reads "can't find project or library".

Any suggestions.

Thanks
 
A

Albert D. Kallal

You could actualy set the default in the table desing..but,

you STILL need to fix the compile error.

You have a broken reference....

Allen Browne
http://allenbrowne.com/ser-38.html

Doug Steele:
http://members.rogers.com/douglas.j.steele/AccessReferenceErrors.html

Peter Walker:
http://www.papwalker.com/dllhell/index-page2.html


MsKb Articles: 310803, 208218, 209849, 286300

ACC2000: How Access 2000 Resolves Visual Basic for Applications References
http://support.microsoft.com/default.aspx?scid=kb;en-us;248941

ACC2000: How to Resolve Reference Issues in an Access Database
http://support.microsoft.com/default.aspx?scid=kb;en-us;310803
 
G

Guest

Works great except:

On some users pc's we get a Compile Error: the "Date" is highlighted and the
error reads "can't find project or library".

Any suggestions.
 
D

Douglas J. Steele

Like a References problem, usually caused by differences between file
versions on the machine where the database was developed and the user's
machine.

Open any code module, then select Tools | References from the menu bar.
Examine all of the selected references.

If any of the selected references have "MISSING:" in front of them, unselect
them, and back out of the dialog. If you really need the reference(s) you
just unselected (you can tell by doing a Compile All Modules), go back in
and reselect them.

If none have "MISSING:", select an additional reference at random, back out
of the dialog, then go back in and unselect the reference you just added. If
that doesn't solve the problem, try to unselect as many of the selected
references as you can (Access may not let you unselect them all), back out
of the dialog, then go back in and reselect the references you just
unselected. (NOTE: write down what the references are before you delete
them, because they'll be in a different order when you go back in)


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


aMack said:
Works great except:

On some users pc's we get a Compile Error: the "Date" is highlighted and
the
error reads "can't find project or library".

Any suggestions.

--
A MACKENZIE, CMA, MBA


Albert D. Kallal said:
the actual steps would be:

open the form in design mode.

Select the form

edit->select form

Now, display the properties sheet for the form (if not displayed already)

view->properties

Now, click on the properties sheet "events" tab

click on the "on load" event to highlight that option.

Note to the right...you see a button appear with ... dots...it looks like
[...]

Click on this button...you usually get 3 choices

choose code....

Now, in the code editor, type in your code

me.NameOfCalendarContorlgoesHere.Value = date

That is it....one line of code....

You of couse change the above contorl name to what you used for the
contorl....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top