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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|