473,396 Members | 1,938 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,396 software developers and data experts.

Default property for a control bounded to a Date/Time field

759 512MB
The original question is located here (AWF)
I'll repeat here if needed.
Have you a solution for this ?

Thank you !
Dec 5 '13 #1
4 846
zmbd
5,501 Expert Mod 4TB
Mihail:
In the cross posted thread it is "asked and answered"

So it would be helpfull for you to restate the question.
I noticed in the cross-post that there was a little confusion about what you were/are after; thus, by restating/rephrasing the question a fresh view might be established.

As for what I've been able to follow, from this link: Set default values for fields or controls (ACC2007/2010) you should be able do what you ask about.

So, re-phrase, show your work (^-^), and as usual we'll give it the best effort
Dec 5 '13 #2
Mihail
759 512MB
Hi, zmbd.

I ask here because, at that time I have had no answer in AWF.
Now the thread in AWF is SOLVED.
I have the solution, thanks to namliam.

The solution is:
Expand|Select|Wrap|Line Numbers
  1. 'In the form module
  2. Private Sub DataComanda_AfterUpdate()
  3.     Me.DataComanda.DefaultValue = EnglishDate2(Me.DataComanda)
  4. End Sub
  5.  
  6. 'and in a regular module:
  7.  
  8. Public Function EnglishDate2(UzualData) As Double
  9. Dim dt As Date
  10.     dt = Month(UzualData) & "/" & Day(UzualData) & "/" & Year(UzualData)
  11.     EnglishDate2 = CDbl(dt)
  12. End Function
If someone will have a better one will be welcoming.
Dec 5 '13 #3
Mihail
759 512MB
@zmbd
As you can see is not a breeze.
Never mind that, in this case, is necessary to convert date to double.
And still I don't understand why/how Microsoft don't implemented a simple way.
Dec 5 '13 #4
zmbd
5,501 Expert Mod 4TB
Glad it worked out for you. Looks a lot like what I though it might; however, I wasn't entirely sure of what you were after from the crosspost.

... and if you ever figure out why MS decides to make things as complicated as they do... you will be very rich indeed when you publish. };-)
Dec 5 '13 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: JP SIngh | last post by:
Can someone please suggest the correct way to store the date & time in SQL Server? I want to store the date and time a record was created. What should the field type be in SQL Server? How can...
9
by: MLH | last post by:
I have a database (datatrek.mdb) with a table named DATA. The table has a date/time field with default value = Now(). It has 100 records in it entered over a 50-minute period. I would like the...
2
by: kaka | last post by:
I'm runnig Redhat 7.3 with postgresql 7.3.4 builded from sources and upgraded recently. I receive this error ( never received before upgrade ) and I don' t know what to do. Error while executing...
3
by: matturbanowski | last post by:
Hi, I have a date/time field in a SQL2000 database, and what I would like to do is to filter on a specific part of the field, for example the time or hour. Supposing I have a set of data for...
1
by: BoxTop | last post by:
Here is an Access 97 problem that's been bugging me for years. On a form I set up a date/time field. I set up the format to be dd/MM/yy hh:nn. I set the input mask to be ##/##/##\ ##:##;0;_ All...
13
by: dizzydangler | last post by:
Just a quick question...I'm running an MS Access 2007 db that tracks appointments in a single table. Date and time are entered as separate fields in short date (mm/dd/yyyy) and short time (hh:mm)...
1
by: neelsfer | last post by:
Is there a way of making a Date/time field in a table a "null value"? I would like to have "long time" as a null value. 05/12/2010 12:38:31 PM. Reason - to add up all the fields with "null values"...
0
by: dowlingm815 | last post by:
I currently importing a csv file with an import specification declaring the field values. one field is a date/time field. when the csv file is imported, it clears the date field with null values....
1
by: Rekha Angappan | last post by:
I have to insert a date/time field in access database from my java code. But the date/time field format in DB is MM/DD/YYYY HH/MM/SS AM/PM.I tried the code below. DateTime date=new DateTime(); ...
6
by: rajeevs | last post by:
Hi I have been searching over the internet to find an answer for my question, but no luck so far. I have an access table with a date/time field and the required property set as No. What I am...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.