A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Dumb Date Question



 
 
Thread Tools Display Modes
  #1  
Old December 14th, 2006, 09:44 PM posted to microsoft.public.access.forms
afr0ninja
external usenet poster
 
Posts: 3
Default Dumb Date Question

Ok, I admit I'm self taught with Access, and that I'm not necessarily
the brightest crayon in the box however, I cannot figure out a stupid
command button date function for the life of me.

I have a command button set up as

txtDate.Value = Now()
BusUnit.SetFocus

The problem is that the Now() function puts in the time into the date
field. This is causing hell with my date queries where I'll miss
information or if I add a +1 to the end of the date range it grabs an
extra date so I really want to simply get rid of the times entered into
the form.

I've tried things I've found on the forum like

me.txtdate = date

It seems that if I try to use 'date' instead of 'now' the code will
just set focus to the next field and not enter a date.

Any assistance or thoughts would be greatly appreciated. Please keep
in mind that I'm rather new to coding so any detailed information would
be.. uhm.. greatly, greatly appreciated!

Thanks in advance!

  #2  
Old December 14th, 2006, 10:03 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default Dumb Date Question

Do you have a field in your table, or a control on your form, or a function
in your application, or anything else named Date?

Date is a function, just like Now. They should elicit identical behaviour.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"afr0ninja" wrote in message
ps.com...
Ok, I admit I'm self taught with Access, and that I'm not necessarily
the brightest crayon in the box however, I cannot figure out a stupid
command button date function for the life of me.

I have a command button set up as

txtDate.Value = Now()
BusUnit.SetFocus

The problem is that the Now() function puts in the time into the date
field. This is causing hell with my date queries where I'll miss
information or if I add a +1 to the end of the date range it grabs an
extra date so I really want to simply get rid of the times entered into
the form.

I've tried things I've found on the forum like

me.txtdate = date

It seems that if I try to use 'date' instead of 'now' the code will
just set focus to the next field and not enter a date.

Any assistance or thoughts would be greatly appreciated. Please keep
in mind that I'm rather new to coding so any detailed information would
be.. uhm.. greatly, greatly appreciated!

Thanks in advance!



  #3  
Old December 14th, 2006, 10:44 PM posted to microsoft.public.access.forms
missinglinq via AccessMonster.com
external usenet poster
 
Posts: 545
Default Dumb Date Question

Instead of

me.txtdate = date

try

me.txtdate.Value = date()

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200612/1

  #4  
Old December 15th, 2006, 01:39 PM posted to microsoft.public.access.forms
afr0ninja
external usenet poster
 
Posts: 3
Default Dumb Date Question


Ok. I think I have come to the conclusion that I need to quit making
databases and go bang my head on a wall for awhile. The table field is
called 'date'. Which now makes perfect sense why it wasn't working
properly. I can't believe I'm that dense =\. I guess now I get to
look to see how much gets broken if I rename the table or just do
without the date button =x. Thank you much for your help!!!

  #5  
Old December 15th, 2006, 01:46 PM posted to microsoft.public.access.forms
dneagle via AccessMonster.com
external usenet poster
 
Posts: 10
Default Dumb Date Question

afr0ninja wrote:
Ok. I think I have come to the conclusion that I need to quit making
databases and go bang my head on a wall for awhile. The table field is
called 'date'. Which now makes perfect sense why it wasn't working
properly. I can't believe I'm that dense =\. I guess now I get to
look to see how much gets broken if I rename the table or just do
without the date button =x. Thank you much for your help!!!


A little advice, if I may. DO NOT name ANY field in your table with a name
that is a reserved name in Access. You will only need to change the field
name, not your table name.

--
David

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200612/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:37 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.