[AccessD] A2K: Formatting height in feet and inches

Bob Gajewski rbgajewski at adelphia.net
Thu Aug 21 00:02:15 CDT 2003


Dear List:

I'm stymied.

I am trying to print identification cards. On those, I want to format the
employee's height as feet and inches. In the report detail section, I have
an unbound text box (txtHeight).

The report's record source = SELECT tblEmployees.*,
tblEmployees.booPrintIDCard AS PrintStatus FROM tblEmployees WHERE
(((tblEmployees.booPrintIDCard)=True));

In tblEmployees, I have a field (intHeight) that is defined as "Number" with
"Field Size = Integer" and "Decimal Places = 1".

I have tried:

*********************************************
Private Sub Detail _Format(Cancel As Integer, FormatCount As Integer)

Dim Feet As Integer, Inches As Integer

' Test for value of intHeight
	MsgBox "Height = " & Me.intHeight

Feet = Me.intHeight / 12
Inches = Me.intHeight - (Feet * 12)

Me!txtHeight = Feet & Chr$(39) & If(Inches > 0," " & Inches & Chr$(34),"")

End Sub
*********************************************

Two problems:

1) When I check the value of intHeight, it is 8640 (for a test record where
the record has a value of intHeight = 72).

2) When I attempt to run the report, I receive "Run-time Error '2465'
Microsoft Access can't find the field 'Me.intHeight' referred to in your
expression."

As usual, I truly appreciate any guidance here.

TIA,
Bob Gajewski




More information about the AccessD mailing list