[AccessD] Droping trailing zero

Steve Turner sturner at mseco.com
Thu Aug 26 14:40:27 CDT 2010


Lambert, here is what I pasted in to make a report print button for new
jobs. The txtNewJob is the textbox I set up to get the number on the
form. If I use a number not ending in zero it works.

Private Sub btnPrNewJob_Click()

    Dim rstNewJobNo As Recordset
    Dim strError As String
    Dim dbs As Database
    Dim qdf As QueryDef
    Dim rst As Recordset
    Dim db As Database
    Dim Job As String
   
 Set dbs = CurrentDb
  Job = txtNewJob
Set rstNewJobNo = dbs.OpenRecordset("NewJobNo")
    With rstNewJobNo
        .Edit
        !LongJobNum = Job
        .Update
    End With
    
    Dim strDocName As String
 strDocName = "rptProjectNumberAssignmentSheet"
On Error GoTo Err_btnPrNewJob_Click

DoCmd.OpenReport strDocName, acViewPreview
Exit_btnPrNewJob_Click:
    Exit Sub

Err_btnPrNewJob_Click:
    If Err = ConErrRptCanceled Then
        Resume Exit_btnPrNewJob_Click
    Else
        MsgBox Err.Description
        Resume Exit_btnPrNewJob_Click
    End If
End Sub

Steve A. Turner
Controller
Mid-South Engineering Co. Inc
E-Mail: sturner at mseco.com and saturner at mseco.com


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan,
Lambert
Sent: Thursday, August 26, 2010 2:32 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Droping trailing zero

Can we see your code?

Lambert 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Steve Turner
Sent: Thursday, August 26, 2010 3:07 PM
To: AccessD at databaseadvisors.com
Subject: [AccessD] Droping trailing zero

Guys,

Need a little help. I have a form that I dropped a text box on to be
able to type in a number or alpha number wanting it to be text. I'm
using A2K. Trying to write this field to a table into a text field. If I
use a number like 5760.40 when it writes to the table it drops the
trailing zero. I've tried formatting the text box properties but if I
add the .40 it will drop the zero. If I leave out the period it seems to
write it to the table without dropping it. If I go into the table itself
and type the number in it doesn't drop the zero. I need it to look like
a number and also something like M501.00 but be a text entry. Anyone
know how to do this.

 

Steve A. Turner
Controller
Mid-South Engineering Co. Inc
P.O. Box 1399
Hot Springs, AR 71902
E-Mail: sturner at mseco.com and saturner at mseco.com
Phone: (501)321-2276
Fax:     (501)321-4750
Cell:     (501)282-7751

 

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

-- 
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