[AccessD] A2K: Formatting height in feet and inches SOLVED

Bob Gajewski rbgajewski at adelphia.net
Thu Aug 21 03:44:33 CDT 2003


I answered my own question. I'm bleary-eyed, but patience won over
frustration - this time!

Instead of CBF, I used the RecordSource for the unbound text box on the
report:

=Int([intHeight]/12) & Chr$(39) & " " &
([intHeight]-(Int([intHeight]/12))*12) & Chr$(34)

Works perfect - problem solved!

Thanks for your assistance!

Bob Gajewski


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Bob Gajewski
Sent: Thursday, August 21, 2003 01:02
To: accessd at databaseadvisors.com
Subject: [AccessD] A2K: Formatting height in feet and inches


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


_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list