Date Input and storage problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to develop the follow and am struggling with the dates - can
someone help please.
Date is to be input by user in dd.mm.yy format - ok using Input mask on
input field on form but how do I code the VB behing my form to set up the
field in the table to store it in this format? Is this possible?
At the moment I either get datatype mismatch or the date stores itself as a
default, completely wrong date.
I've tried using Format(datestring, "dd.mm.yy) which when I run it as a
function with a hard coded date displays what I want but I can transfer that
in to the context I need.
I have set up a Custom format for the table and some other forms that I am
displying these dates on but my problem is getting them into the table in the
first place via the input form.
 
kbrad said:
I am trying to develop the follow and am struggling with the dates -
can someone help please.
Date is to be input by user in dd.mm.yy format - ok using Input mask
on input field on form but how do I code the VB behing my form to set
up the field in the table to store it in this format? Is this
possible?

Dates should be stored in date type fields. It will be stored as a number.
How it looks is determined by the formatting.
I hate Input masks because most people want to be able to enter the date in
a rapid manner.

I can enter 3 5 and the date will be displayed as 03/05/05, March 5, 2005,
2005 5 March, Saturday March 5th 2005, or any other way I want.

If you do use a mask teach your users to click on the label rather than the
box to place the cursor at the start of the field.
 
Quite a bit of my question is missing from the reply: I have repasted it as
I'm still am not getting anywhere.
When I type in 02.03.05, as my input mask allows on the form, the date that
is saved in my table is 30.12.99. If I then click in the field in the table
it displays 02:03:05 similar but not the same. It also is not displaying on
another form as 02.03.05 but as 30.12.99.
I am saving it to the table using table.Add new, setting up the fields in
the table = to the form fields then table.Update - any ideas?


I am trying to develop the follow and am struggling with the dates - can
someone help please.
Date is to be input by user in dd.mm.yy format - ok using Input mask on
input field on form but how do I code the VB behing my form to set up the
field in the table to store it in this format? Is this possible?
At the moment I either get datatype mismatch or the date stores itself as a
default, completely wrong date.
I've tried using Format(datestring, "dd.mm.yy) which when I run it as a
function with a hard coded date displays what I want but I can transfer that
in to the context I need.
I have set up a Custom format for the table and some other forms that I am
displying these dates on but my problem is getting them into the table in the
first place via the input form.
 
kbrad said:
Quite a bit of my question is missing from the reply: I have repasted
it as I'm still am not getting anywhere.
When I type in 02.03.05, as my input mask allows on the form, the
date that is saved in my table is 30.12.99. If I then click in the
field in the table it displays 02:03:05 similar but not the same. It
also is not displaying on another form as 02.03.05 but as 30.12.99.
I am saving it to the table using table.Add new, setting up the
fields in the table = to the form fields then table.Update - any
ideas?

02.03.05 will, in a date field, be converted to time.
What is your input mask?
Using a period as a delimiter may be your problem.
I don't know what gets stored in the date portion under these conditions.
 
My Input mask is 00.00.00;0;* with * being the placeholder.

:
02.03.05 will, in a date field, be converted to time.
What is your input mask?
Using a period as a delimiter may be your problem.
I don't know what gets stored in the date portion under these conditions.
 
kbrad said:
My Input mask is 00.00.00;0;* with * being the placeholder.

:
02.03.05 will, in a date field, be converted to time.
What is your input mask?
Using a period as a delimiter may be your problem.
I don't know what gets stored in the date portion under these
conditions.

I just tried it and the periods are the problem MSFT translatesd these into
colons and assumes you want to enter a time.
If you format the text box for a date it fails.
Either change your delimiters to the / or get rid of the mask entirely.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top