date format

  • Thread starter Thread starter Jean-Paul De Winter
  • Start date Start date
J

Jean-Paul De Winter

Hi
following code runs perfectly

X = 18
AANTAL = 17 + aantalvangetuigther
If aantalvangetuigther > 11 Then AANTAL = AANTAL + 20
For X = 18 To AANTAL Step 1
If X = 28 Then X = 48
Y = X + 10
z = X + 20
Forms!rekening(X) = tb3!DATUM
Forms!rekening(Y) = tb3!CODE
Forms!rekening(z) = tb3!GETUIGTHER
tb3.MoveNext
Next

tb3!datum is a date that looks like: 01/01/2006

I want is to be in following format: dd/mm/yy so I wrote

Forms!rekening(X) = Format(tb3!DATUM, "dd/mm/yy")

this doesn't seem to work...
Any idea?
Thanks
 
Jean-Paul De Winter said:
Hi
following code runs perfectly

X = 18
AANTAL = 17 + aantalvangetuigther
If aantalvangetuigther > 11 Then AANTAL = AANTAL + 20
For X = 18 To AANTAL Step 1
If X = 28 Then X = 48
Y = X + 10
z = X + 20
Forms!rekening(X) = tb3!DATUM
Forms!rekening(Y) = tb3!CODE
Forms!rekening(z) = tb3!GETUIGTHER
tb3.MoveNext
Next

tb3!datum is a date that looks like: 01/01/2006

I want is to be in following format: dd/mm/yy so I wrote

Forms!rekening(X) = Format(tb3!DATUM, "dd/mm/yy")

this doesn't seem to work...
Any idea?
Thanks

If Forms!rekening(X) is bound to a DateTime field then the format of a value
you push into it is irrelevant. All that matters is the format property you
have on the form control itself.
 
Rick said:
If Forms!rekening(X) is bound to a DateTime field then the format of a value
you push into it is irrelevant. All that matters is the format property you
have on the form control itself.
The rest is rather strange but works...
I indeed get the dat on a form, just like I want is (format dd/mm/yy...
no problem)
Then I open an empty table and store all dates form the form into the
correct fields (these are text fileds)
once this is done, I print a report based upon this table.
The data on the form are displayed like I want but are stored in yyyy
format so THIS is the moment when things go wrong.
See??? (I hope so)
Thanks
JP
 
Jean-Paul De Winter said:
The rest is rather strange but works...
I indeed get the dat on a form, just like I want is (format
dd/mm/yy... no problem)
Then I open an empty table and store all dates form the form into the
correct fields (these are text fileds)
once this is done, I print a report based upon this table.
The data on the form are displayed like I want but are stored in yyyy
format so THIS is the moment when things go wrong.
See??? (I hope so)
Thanks
JP

Doesn't sound like text fields to me. Text fields don't store data one way and
display it another. DateTime fields do though so if that is what you have then
you need to set the format property of the control on your report to the format
what you want. Format settings in tables and queries generally don't carry over
to forms and reports.
 

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

Similar Threads

access system date format 1
Date problem 5
Format Problem 4
Converting date entry from mm/dd to mm/yy 16
Need help formatting a sheet 0
Format Current Date 3
strange way to compare dates 2
date field 4

Back
Top