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
|
|||
|
|||
Form and default dates
Related to my question below.... I'm setting up a form to filter results of a
query, I'm trying to set default dates (at the least so when you open the form nothing will be filtered by default, at the best I'd like to be able to open the form directly without it prompting me to enter values for the filters and just show everything by default) At any rate I have 2 issues now. First no matter what I put in Default Value for my date entry boxes on my filtering form, 12/30/1899 shows up in both. Second as soon as I click in one of the boxes to enter a date it changes from 12/30/1899 to a time like 12:07:10 AM or something. Short Date is selected as the format for both boxes. |
#2
|
|||
|
|||
Form and default dates
Access stores the date 12/30/1899 as 0. Therefore something in that field is
already showing a 0. What is the default value in the table? That's probably where you want to set it anyway. Also remember that the default value is only for new records. If you open the form to an existing record, Access will display what is there. The other number for abut 7 minutes into the day is about 0.0049. Hard telling where that comes from. -- Jerry Whittle, Microsoft Access MVP Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder. "Robbro" wrote: Related to my question below.... I'm setting up a form to filter results of a query, I'm trying to set default dates (at the least so when you open the form nothing will be filtered by default, at the best I'd like to be able to open the form directly without it prompting me to enter values for the filters and just show everything by default) At any rate I have 2 issues now. First no matter what I put in Default Value for my date entry boxes on my filtering form, 12/30/1899 shows up in both. Second as soon as I click in one of the boxes to enter a date it changes from 12/30/1899 to a time like 12:07:10 AM or something. Short Date is selected as the format for both boxes. |
#3
|
|||
|
|||
Form and default dates
Apparently even though I've set it to Short Date its interpreting 2/20/2010
as 2 divided by 20 divided by 2010. I guess I need to do somethign else to make it recognize that as a date? "Jerry Whittle" wrote: Access stores the date 12/30/1899 as 0. Therefore something in that field is already showing a 0. What is the default value in the table? That's probably where you want to set it anyway. Also remember that the default value is only for new records. If you open the form to an existing record, Access will display what is there. The other number for abut 7 minutes into the day is about 0.0049. Hard telling where that comes from. -- Jerry Whittle, Microsoft Access MVP Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder. "Robbro" wrote: Related to my question below.... I'm setting up a form to filter results of a query, I'm trying to set default dates (at the least so when you open the form nothing will be filtered by default, at the best I'd like to be able to open the form directly without it prompting me to enter values for the filters and just show everything by default) At any rate I have 2 issues now. First no matter what I put in Default Value for my date entry boxes on my filtering form, 12/30/1899 shows up in both. Second as soon as I click in one of the boxes to enter a date it changes from 12/30/1899 to a time like 12:07:10 AM or something. Short Date is selected as the format for both boxes. |
#4
|
|||
|
|||
Form and default dates
While you are using a web browser, at least 90% of those who are
knowledgeable enough to answer will be using newsreaders (like Agent, Outlook Express, Windows Mail, or Thunderbird). We have no idea what your question below is. For anyone using a web browser, below could be on a completely different page and they couldn't find it without persistence and luck, That said, your answers are in line: "Robbro" wrote in message news Related to my question below.... I'm setting up a form to filter results of a query, I'm trying to set default dates (at the least so when you open the form nothing will be filtered by default, at the best I'd like to be able to open the form directly without it prompting me to enter values for the filters and just show everything by default) At any rate I have 2 issues now. First no matter what I put in Default Value for my date entry boxes on my filtering form, 12/30/1899 shows up in both. Second as soon as I click in one of the boxes to enter a date it changes from 12/30/1899 to a time like 12:07:10 AM or something. Short Date is selected as the format for both boxes. Somewhere the default is set to 0 (zero) which is 12/30/1899. Check the table, the form, and any code connected to the textbox or form. Similar to the first problem is the second. I'd guess it's likely code in the GotFocus, or Rnter property of the textboxes causing both problems. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.accessmvp.com http://www.mvps.org/access |
#5
|
|||
|
|||
Form and default dates
#2/20/2010# ?
-- Jerry Whittle, Microsoft Access MVP Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder. "Robbro" wrote: Apparently even though I've set it to Short Date its interpreting 2/20/2010 as 2 divided by 20 divided by 2010. I guess I need to do somethign else to make it recognize that as a date? "Jerry Whittle" wrote: Access stores the date 12/30/1899 as 0. Therefore something in that field is already showing a 0. What is the default value in the table? That's probably where you want to set it anyway. Also remember that the default value is only for new records. If you open the form to an existing record, Access will display what is there. The other number for abut 7 minutes into the day is about 0.0049. Hard telling where that comes from. -- Jerry Whittle, Microsoft Access MVP Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder. "Robbro" wrote: Related to my question below.... I'm setting up a form to filter results of a query, I'm trying to set default dates (at the least so when you open the form nothing will be filtered by default, at the best I'd like to be able to open the form directly without it prompting me to enter values for the filters and just show everything by default) At any rate I have 2 issues now. First no matter what I put in Default Value for my date entry boxes on my filtering form, 12/30/1899 shows up in both. Second as soon as I click in one of the boxes to enter a date it changes from 12/30/1899 to a time like 12:07:10 AM or something. Short Date is selected as the format for both boxes. |
#6
|
|||
|
|||
Form and default dates
On Wed, 17 Mar 2010 07:00:01 -0700, Robbro
wrote: Apparently even though I've set it to Short Date its interpreting 2/20/2010 as 2 divided by 20 divided by 2010. I guess I need to do somethign else to make it recognize that as a date? My guess is that you've put just 2/20/2010 in the DefaultValue property. That's being interpreted as 2, divided by 20, divided by 2010 - .00004975... , which when translated to a date/time is about 12:00:04 on January 30, 1899. The trick is that the default value must be a String - try "2/20/2010" or, better, use the builtin date functions to set it to a date tied to today's date. For instance if you want it to default to tomorrow's date, you could set the textbox's default value property to =DateAdd("d", 1, Date()) or for the first of the current month to =DateSerial(Year(Date()), Month(Date()), 1) -- John W. Vinson [MVP] |
#7
|
|||
|
|||
Form and default dates
"Arvin Meyer [MVP]" wrote in
: While you are using a web browser, at least 90% of those who are knowledgeable enough to answer will be using newsreaders (like Agent, Outlook Express, Windows Mail, or Thunderbird). We have no idea what your question below is. For anyone using a web browser, below could be on a completely different page and they couldn't find it without persistence and luck, There's no guarantee of proper ordering in a news reader, either. Some newsreaders thread on the References: line, others on other information in the headers. And a user can read in threaded view or sort by subject and date, or all posts by date, etc. -- David W. Fenton http://www.dfenton.com/ usenet at dfenton dot com http://www.dfenton.com/DFA/ |
#8
|
|||
|
|||
Form and default dates
John W. Vinson wrote in
: For instance if you want it to default to tomorrow's date, you could set the textbox's default value property to =DateAdd("d", 1, Date()) Why bother with DateAdd() when Date() + 1 will give exactly the same result? Sure, for anything other than days, you need DateAdd(), but given that the integer part of a value of date type is the number of days since 12/30/1899, you can add/subtract days without using DateAdd(). -- David W. Fenton http://www.dfenton.com/ usenet at dfenton dot com http://www.dfenton.com/DFA/ |
#9
|
|||
|
|||
Form and default dates
"David W. Fenton" wrote in message
36.99... "Arvin Meyer [MVP]" wrote in : While you are using a web browser, at least 90% of those who are knowledgeable enough to answer will be using newsreaders (like Agent, Outlook Express, Windows Mail, or Thunderbird). We have no idea what your question below is. For anyone using a web browser, below could be on a completely different page and they couldn't find it without persistence and luck, There's no guarantee of proper ordering in a news reader, either. Some newsreaders thread on the References: line, others on other information in the headers. And a user can read in threaded view or sort by subject and date, or all posts by date, etc. Yes but most of that is under the user's control. Besides it doesn't change the fact that "question below" is meaningless in most cases. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.accessmvp.com http://www.mvps.org/access |
#10
|
|||
|
|||
Form and default dates
"Arvin Meyer [MVP]" wrote in
: "David W. Fenton" wrote in message 36.99... "Arvin Meyer [MVP]" wrote in : While you are using a web browser, at least 90% of those who are knowledgeable enough to answer will be using newsreaders (like Agent, Outlook Express, Windows Mail, or Thunderbird). We have no idea what your question below is. For anyone using a web browser, below could be on a completely different page and they couldn't find it without persistence and luck, There's no guarantee of proper ordering in a news reader, either. Some newsreaders thread on the References: line, others on other information in the headers. And a user can read in threaded view or sort by subject and date, or all posts by date, etc. Yes but most of that is under the user's control. Besides it doesn't change the fact that "question below" is meaningless in most cases. I think it's meaningless outside the sole context in which the user is reading -- it won't mean anything to anybody else, ever, except accidentally. It's like with people asking about having their data tables in Access sorted -- sort order is something you do in SQL, for a particular situation, not something inherent to the data (at least not in any obvious way, clustered indexes aside). -- David W. Fenton http://www.dfenton.com/ usenet at dfenton dot com http://www.dfenton.com/DFA/ |
Thread Tools | |
Display Modes | |
|
|