473,320 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

date, default value

Hello, can anabody help?

in the following part i cannot pass de desired default value

In the module of the mbd i declared:

Global datum_Glo As String

in a form (Dossier_FRM)i did

Private Sub Fact_CMD_Click()
On Error Resume Next
datum_Glo = Me.[SubContact_FRM]![datum]
DoCmd.OpenForm "Facturatie_FRM", acNormal, , , acFormEdit
End Sub
([datum] is a date field in the table/query)
when facturatie_FRM opens i stated

Private Sub Form_Load()
Me.Datum_TXT.DefaultValue = "#" & datum_Glo & "#"
DoCmd.RunCommand acCmdRecordsGoToNew
End Sub
(the source of Datum_TXT is a date field)
this gives in the textfield the corect value EXECPT with dates with
day() below the 13th: e.g. 1/04/2004 does not give first april but 4th
januari or 12/04/2004 return 4th of december, while 13/04/2004 the
13th of april correctly.
when datum_Glo was declared as date each date-value of
Me.[SubContact_FRM]![datum] results in the default value 31/12/1988;
so this does not solve the problem.

thanks for help

Marc Delatere
Nov 13 '05 #1
1 4459
Every time you enclose a date in # delimiters, Access assumes it's in
mm/dd/yyyy format, regardless of what your regional settings may have set
the Short Date format to.

Try:

Me.Datum_TXT.DefaultValue = Format(datum_Glo, "\#mm\/dd\/yyyy\#")

(If you're curious, the \ characters in the format are "escape characters"
to ensure that the character that follows is inserted literally. In other
words, \# will ensure that the # delimiter is included, while \/ ensures
that the date delimiter will be /)

For more about working with dates in non mm/dd/yyyy format, check out Allen
Browne's "International Dates in Access" at
http://members.iinet.net.au/~allenbrowne/ser-36.html or what I have at
http://members.rogers.com/douglas.j....artAccess.html

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

"Delatere" <ma***********@advalvas.be> wrote in message
news:25**************************@posting.google.c om...
Hello, can anabody help?

in the following part i cannot pass de desired default value

In the module of the mbd i declared:

Global datum_Glo As String

in a form (Dossier_FRM)i did

Private Sub Fact_CMD_Click()
On Error Resume Next
datum_Glo = Me.[SubContact_FRM]![datum]
DoCmd.OpenForm "Facturatie_FRM", acNormal, , , acFormEdit
End Sub
([datum] is a date field in the table/query)
when facturatie_FRM opens i stated

Private Sub Form_Load()
Me.Datum_TXT.DefaultValue = "#" & datum_Glo & "#"
DoCmd.RunCommand acCmdRecordsGoToNew
End Sub
(the source of Datum_TXT is a date field)
this gives in the textfield the corect value EXECPT with dates with
day() below the 13th: e.g. 1/04/2004 does not give first april but 4th
januari or 12/04/2004 return 4th of december, while 13/04/2004 the
13th of april correctly.
when datum_Glo was declared as date each date-value of
Me.[SubContact_FRM]![datum] results in the default value 31/12/1988;
so this does not solve the problem.

thanks for help

Marc Delatere

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much...
2
by: Rob | last post by:
Hello all I have a field (called active) of type DATE and I want to add a default value. The default value must be the current date. Is this possible to do this in the table create statement? ...
5
by: tshad | last post by:
I have the following code: *************************************************************************** Dim CommandText as String = "INSERT INTO ftsolutions.dbo.position (client,dateposted) VALUES...
12
by: Rob T | last post by:
I'm storing a date/time into a SQL table of type datetime. I need it to be precise so the value is stored to the 1000th of a second. ie "insert into myTable mydate values ('08/05/2005...
15
by: Khurram | last post by:
I have a problem while inserting time value in the datetime Field. I want to Insert only time value in this format (08:15:39) into the SQL Date time Field. I tried to many ways, I can extract...
10
by: John Austin | last post by:
I am migrating my first vb6 app to vb.net 2003. In the vb6 app a number of subs had optional date parameters: Sub Fred ( ... ,optional FromDate as Date = 0...) I need something like zero in...
5
by: Øyvind Isaksen | last post by:
I have a page with an optional integer-field, and one asp:calendar control. I use a stored procedure to save the data in SQL Server. When all fields contains data, the code works great! But if the...
2
by: syntego | last post by:
We commonly use triggers to log changes to our main tables to historical log tables. In the trigger, we create a concatenated string of the old values by casting them as follows: ...
3
by: Finn Stampe Mikkelsen | last post by:
Hi I have defined a table in my database, with 2 date-fields. I have set a default value to DBNull. I have integrated a nullable datetimepicker control to my project and set the apropriate...
13
by: chromis | last post by:
Hi, I have a query which updates the projects table of my database, however when I try to run my query with blank values i get the following error: Data truncation: Data truncated for column...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.