Re: Manipulating dates



On Fri, 28 Sep 2007 20:32:24 -0000, Denis wrote:

I have a date field in a database. I have been given forms to be
printed out.
The problem is that the form requires the date to be printed out in 3
seperate parts. In the form day month and year.
All numberic with the year in the form of 07 06 05 etc instead of
2007
2006 2005 etc.

set the format property of the date control to:
dd/mm/yy



Another issue this form has brought is that I have a membership
number
field as an 8 digit string.
The form requires the number to be printed one charachter per box so
I
need to split the string.

Is the above possible and how would I go about it.

Thanks

Denis


Add 8 unbound text controls to your report.

An easy way to add 8 controls is to add 1. Select it Copy and paste.
Select these 2, Copy and Paste, Select these 4, Copy and paste and you
now have 8 controls.

Delete all of their labels. Size the controls to whatever height and
width will work. Name them "Text1", "Text2", etc... "Text8".
Position them in order, left to right.
Space them using Format + Horizontal Spacing Make Equal. Align them.

Set their Border Style to Solid, Border Width to 1 pt size.

Code the Report Section's Format event.
If they're in the Detail section, then:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim intX As Integer
Dim intY As Integer
intX = 1

For intX = 1 To Len([FieldName])
Me("Text" & intX) = Mid([FieldName], intX, 1)
Me("Text" & intX).Visible = True
Next intX

' To hide extra boxes or to show empty boxes
For intY = intX To 8
Me("Text" & intY).Visible = False ' To hide extra boxes
' Me("Text" & intY) = "" ' To show the box but delete the text
Next intY

End Sub

Set the control's FontSize to one that will match the size of the
box. Set the Alignment to Center.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
.



Relevant Pages

  • Re: Manipulating dates
    ... Add 8 unbound text controls to your report. ... Space them using Format + Horizontal Spacing Make Equal. ... Dim intX As Integer ... Dim intY As Integer ...
    (comp.databases.ms-access)
  • Re: Dynamic Creation of Option Group
    ... Grwffyn wrote: ... For intY = intX To intTotal ... colRadio.Add (ctlArray(intX, intY)) ... controls with names like ctl03_07. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Displaying controls as separated values in boxes on a report
    ... I need to get the T in a box or put a border round it, then the R etc etc etc. ... Add 16 unbound text controls to your report. ... Dim intX As Integer ... Dim intY As Integer ...
    (microsoft.public.access.reports)
  • Re: Displaying controls as separated values in boxes on a report
    ... I need to get the T in a box or put a border round it, then the R etc etc etc. ... Add 16 unbound text controls to your report. ... Dim intX As Integer ... Dim intY As Integer ...
    (microsoft.public.access.reports)
  • Re: Bug in Access 2002 Reports
    ... from within the Detail Section format event ... This will give the report a feeling of being "to scale", when you look at it you can see there are smaller, larger or equal intervals. ... Access will format the section but it will remember the last placement of the controls. ...
    (microsoft.public.access.reports)