Gustav Brock
Gustav at cactus.dk
Tue Nov 2 02:02:53 CDT 2010
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