J
JimAA
Hi,
I have a text box on a form (ChangeOrderSeq) where I would like to display a
number based on the count of records and a the result from a yes/no box
(NoteOnly). For sorting purposes I need that number to be have one decimal
place precision. I can't get the number to show decimal places. The table
field data type for ChangeOrderSeq is "Number" and field size is "Decimal".
The ChangeOrderSeq text box on the form is formatted to General Number and
one decimal place. Is there something with ListCount that only allows the
numbers to be whole?
Below if the code that I used.
Thanks
Private Sub BtnAddNew_Click()
On Error GoTo Err_BtnAddNew_Click
DoCmd.GoToRecord , , acNewRec
Me.ChangeOrderSeq.SetFocus
If Me.NoteOnly = 0 Then_
Me.ChangeOrderSeq = Me.LstDetailID.ListCount + 1 -
((DCount("[NoteOnly]", "qryChangeOrderDetails", "[NoteOnly]=-1")))_
Else: Me.ChangeOrderSeq = Me.LstDetailID.ListCount + 0.9 -
(((DCount("[NoteOnly]", "qryChangeOrderDetails", "[NoteOnly]=-1"))))_
End If
Exit_BtnAddNew_Click:
Exit Sub
Err_BtnAddNew_Click:
MsgBox Err.Description
Resume Exit_BtnAddNew_Click
End Sub
I have a text box on a form (ChangeOrderSeq) where I would like to display a
number based on the count of records and a the result from a yes/no box
(NoteOnly). For sorting purposes I need that number to be have one decimal
place precision. I can't get the number to show decimal places. The table
field data type for ChangeOrderSeq is "Number" and field size is "Decimal".
The ChangeOrderSeq text box on the form is formatted to General Number and
one decimal place. Is there something with ListCount that only allows the
numbers to be whole?
Below if the code that I used.
Thanks
Private Sub BtnAddNew_Click()
On Error GoTo Err_BtnAddNew_Click
DoCmd.GoToRecord , , acNewRec
Me.ChangeOrderSeq.SetFocus
If Me.NoteOnly = 0 Then_
Me.ChangeOrderSeq = Me.LstDetailID.ListCount + 1 -
((DCount("[NoteOnly]", "qryChangeOrderDetails", "[NoteOnly]=-1")))_
Else: Me.ChangeOrderSeq = Me.LstDetailID.ListCount + 0.9 -
(((DCount("[NoteOnly]", "qryChangeOrderDetails", "[NoteOnly]=-1"))))_
End If
Exit_BtnAddNew_Click:
Exit Sub
Err_BtnAddNew_Click:
MsgBox Err.Description
Resume Exit_BtnAddNew_Click
End Sub