In my subform sfrmOrders i have the following code in relation to the field "Qty". Normaly after entering aa amount in this field ,the program calculates the amount that can be delivered, based on the amount of stock. But no amount appears in the field "Delvered" In order to find out what is happening, i placed a messagebox in the code ( see red colored code). Whe i run the program now i get the message : Error 94 , unproper ( or unlegal ) i do not know the exact translation ) of NULL.
In my table tblOrderdetails, the field 'Deliverd is of typ numeric, long integer, precisely the same as for the field "Qty' for which i do not get this error message. What's going on here?
Private Sub Qty_Click()
On Error GoTo ErrorHandler
PresentQty = Nz(Me![Qty], 0)
Presentbackorder = Nz(Me![Backorder], 0)
Afsluiten:
On Error GoTo 0
Exit Sub
ErrorHandler:
Mededeling = foutbericht("Qty_Click", "sfrmOrders", Err.Number)
Resume Afsluiten
End Sub
Private Sub Qty_BeforeUpdate(Cancel As Integer)
On Error GoTo ErrorHandler
If Me!Qty = 0 Or Me!Qty & "" = "" Then
MsgBox ("The Qty must be larger then 0 ")
DoCmd.CancelEvent
End If
Afsluiten:
On Error GoTo 0
Exit Sub
ErrorHandler:
Mededeling = foutbericht("Qty_BeforeUpdate", "sfrmOrders", Err.Number)
Resume Afsluiten
End Sub
Private Sub Qty_AfterUpdate()
On Error GoTo ErrorHandler
...
ElseIf QTY > PresentQty Then
Toename = Qty - PresentQtY
If Stock > 0 Then
If Stock >= Toename Then
Delivered = Delivered + Toename
MsgBox " delivered is " & Cstr(Delivered)
Voorraad = Voorraad - Toename
...
...
Afsluiten:
On Error GoTo 0
Exit Sub
ErrorHandler:
Mededeling = foutbericht("QTY_AfterUpdate", "sfrmOrders", Err.Number)
Resume Afsluiten
End Sub
In my table tblOrderdetails, the field 'Deliverd is of typ numeric, long integer, precisely the same as for the field "Qty' for which i do not get this error message. What's going on here?
Private Sub Qty_Click()
On Error GoTo ErrorHandler
PresentQty = Nz(Me![Qty], 0)
Presentbackorder = Nz(Me![Backorder], 0)
Afsluiten:
On Error GoTo 0
Exit Sub
ErrorHandler:
Mededeling = foutbericht("Qty_Click", "sfrmOrders", Err.Number)
Resume Afsluiten
End Sub
Private Sub Qty_BeforeUpdate(Cancel As Integer)
On Error GoTo ErrorHandler
If Me!Qty = 0 Or Me!Qty & "" = "" Then
MsgBox ("The Qty must be larger then 0 ")
DoCmd.CancelEvent
End If
Afsluiten:
On Error GoTo 0
Exit Sub
ErrorHandler:
Mededeling = foutbericht("Qty_BeforeUpdate", "sfrmOrders", Err.Number)
Resume Afsluiten
End Sub
Private Sub Qty_AfterUpdate()
On Error GoTo ErrorHandler
...
ElseIf QTY > PresentQty Then
Toename = Qty - PresentQtY
If Stock > 0 Then
If Stock >= Toename Then
Delivered = Delivered + Toename
MsgBox " delivered is " & Cstr(Delivered)
Voorraad = Voorraad - Toename
...
...
Afsluiten:
On Error GoTo 0
Exit Sub
ErrorHandler:
Mededeling = foutbericht("QTY_AfterUpdate", "sfrmOrders", Err.Number)
Resume Afsluiten
End Sub