Rocky Smolin
rockysmolin at bchacc.com
Tue Nov 2 08:51:54 CDT 2010
Gustav: I got the same result. I unbound the combo box just to eliminate that variable, but no difference. The format of the combo box is Percent. So I also tried taking that out. But entering .18 still generates the error message and entering 0.18 works fine. Now I should note that after I get the standard error message ("The text you entered is not an item..."etc) the value I entered is displayed in the combo box. Although the focus is still on the box. So if I can get rid of that message, I think everything else would be OK. TIA 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 12:03 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Not In List Event Hi Rocky You probably pass a string that needs to be converted: rs!fldPercentValue = Val(NewData) Thus: dblNewVal = Val(NewData) intReply = MsgBox("The value " & Format(dblNewVal, "Fixed") & " is not in the " & Me.fldBaitPercent.Tag _ & " percent list. Do you want to add it?", vbYesNo, "New Value") If intReply = vbNo Then Response = acDataErrContinue 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 /gustav >>> rockysmolin at bchacc.com 02-11-2010 06:02:51 >>> Jurgen: I added the dblNewVal = rs!fldPercentValue and Me.fldBaitPercent = dblNewVal where you indicated: intReply = MsgBox("The value " & NewData & " is not in the " & Me.fldBaitPercent.Tag _ & " percent list. Do you want to add it?", vbYesNo) If intReply = vbNo Then Response = acDataErrContinue Else Set db = CurrentDb Set rs = db.OpenRecordset("Select * FROM tblPercents") rs.AddNew rs!fldPercentType = Me.fldBaitPercent.Tag rs!fldPercentValue = NewData dblNewVal = rs!fldPercentValue rs.Update rs.Close Set rs = Nothing Me.fldBaitPercent = dblNewVal Response = acDataErrAdded End If But it made no difference. If I enter a new value like 0.25 is works but if I enter just .25 it fails. TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com