[AccessD] A2K: Formatting height in feet and inches

William Hindman wdhindman at bellsouth.net
Thu Aug 21 00:53:57 CDT 2003


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

...typo on the IIf?

William Hindman
So, then, to every man his chance -- to every man, regardless of his birth,
his shining golden opportunity -- to every man his right to live, to work,
to be himself, to become whatever his manhood and his vision can combine to
make him -- this, seeker, is the promise of America.
-- Thomas Wolfe



----- Original Message ----- 
From: "Bob Gajewski" <rbgajewski at adelphia.net>
To: <accessd at databaseadvisors.com>
Sent: Thursday, August 21, 2003 1:02 AM
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