date format

  • Thread starter Jean-Paul De Winter
  • 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
 
J

Jean-Paul De Winter

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
 
R

Rick Brandt

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.
 
Top