----- Original Message -----
From: "Fred Zuckerman" <Zu********@sbcglobal.net>
Newsgroups: comp.databases.ms-access
Sent: Friday, June 30, 2006 12:25 PM
Subject: Re: fraction number format?
What if you create another text control on the form and/or report. The
value
for this text control can be calculated as a function of the quantity
field.
Air code below:
Public Function Qty2 (Mqty As Double) As String
' Get decimal portion of quantity
Mdec = Mqty - Int(Mqty)
Select Case Mdec
Case 0.25
Qty2 = Ctext(Int(Mqty)) & " 1/4"
Case 0.50
Qty2 = Ctext(Int(Mqty)) & " 1/2"
Case 0.75
Qty2 = Ctext(Int(Mqty)) & " 3/4"
Case Else
Qty2 = Ctext(Mqty)
End Select
You could add Case stmts for the 'eighths' if necessary.
Probably the 'quarters' is sufficient.
Fred Zuckerman
Great idea Fred. In fact, instead of interacting directly between the
keyboard and the table, I could have an unbound textbox that could interpret
the data entry and convert it into the appropriate numeric value before
appending to or updating the table(s) using INSERT INTO and/or UPDATE
queries, then reversing the same process to generate the reports (recipes,
etc.). All the user will see is the fraction format as text even though the
table sees the number as a double and will never see the text. I'll have to
do some reworking now but only with the data entry form(s). All the data is
already in double format. It might just be easier to write new forms and
delete the old ones.