[AccessD] Not In List Event

Rocky Smolin rockysmolin at bchacc.com
Tue Nov 2 11:48:28 CDT 2010


Ah, yes.  Forgot that.  But now, since there's no way to get that leading
zero in there, every value I enter gives the error message.  

Rocky
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Tuesday, November 02, 2010 9:31 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Not In List Event

Hi Rocky

Yes. If you wish to display and enter percentage, you will have to enter
percentage as 1.7 or 1.70, not 0.017.

/gustav


>>> rockysmolin at bchacc.com 02-11-2010 17:19:27 >>>
Gustav:

Changing to  dblNewVal = Val(NewData) / 100 and entering 0.017 gives .00017.
dblNewVal is too small by factor of 100 now.

Rocky


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Tuesday, November 02, 2010 8:44 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Not In List Event

Hi Rocky

OK, that explains.
Now use this:

    dblNewVal = Val(NewData) / 100
    intReply = MsgBox("The value " & Format(dblNewVal, "Percent") & " is not
in the " & Me.fldBaitPercent.Tag _
        & " percent list. Do you want to add it?", vbYesNo, "New Value")
    If intReply = vbNo Then
        Response = acDataErrContinue
        ' <NameOfYourComboBox>.Undo
    Else
        Set db = CurrentDb
        Set rs = db.OpenRecordset("Select Top 1 * FROM tblPercents")
        rs.AddNew
        rs!fldPercentType = Me.fldBaitPercent.Tag
        rs!fldPercentValue = dblNewVal
        rs.Update
        rs.Close
        Set rs = Nothing
        Me.fldBaitPercent = dblNewVal
        Response = acDataErrAdded
    End If

That works here.

/gustav


>>> rockysmolin at bchacc.com 02-11-2010 16:26:11 >>>
I changed the format of the combo box to Percent but when I enter 26 it
comes out as 2600% instead of 26%.  And gets stored in the table as 26
instead of .26

R


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