I'm working on an RMA Database.
My problem is that I want to check if a RMA number is availible in the database. If so I can close this RMA. This works fine BUT now I also want to add the check if some felds are emty. If these felds are emty the RMA may not be closed.
I'm using the folowing code to check if the RMA number is availible in the database;
**code**
Private Sub Rma_Number_AfterUpdate()
If Nz(DLookup("[rma number]", "tblrma", "[rma Number] = '" & Screen.ActiveForm.Rma_Number & " )) = True Then
DoCmd.SetWarnings False
Dim stDocName As String
stDocName = "qryUpdatePutaway"
DoCmd.OpenQuery stDocName, acNormal, acEdit
MsgBox "Rma Closed"
'DoCmd.Save
'DoCmd.GoToRecord , , acNext
Forms("frmCloseRma").[Rma_Number].SetFocus
Else
MsgBox "RMA Number " & Rma_Number & " bestaat niet ! : ", vbCritical, "Duplicaat !!"
Forms("frmCloseRma").[Rma_Number].SetFocus
End If
End Sub
//code//
My question is how can I add the check if these fields are emty??
I would also like to have a msgbox if the RMA number is availible but the fields
are not emty.
Does anyone know how to make this work??
Martijn
My problem is that I want to check if a RMA number is availible in the database. If so I can close this RMA. This works fine BUT now I also want to add the check if some felds are emty. If these felds are emty the RMA may not be closed.
I'm using the folowing code to check if the RMA number is availible in the database;
**code**
Private Sub Rma_Number_AfterUpdate()
If Nz(DLookup("[rma number]", "tblrma", "[rma Number] = '" & Screen.ActiveForm.Rma_Number & " )) = True Then
DoCmd.SetWarnings False
Dim stDocName As String
stDocName = "qryUpdatePutaway"
DoCmd.OpenQuery stDocName, acNormal, acEdit
MsgBox "Rma Closed"
'DoCmd.Save
'DoCmd.GoToRecord , , acNext
Forms("frmCloseRma").[Rma_Number].SetFocus
Else
MsgBox "RMA Number " & Rma_Number & " bestaat niet ! : ", vbCritical, "Duplicaat !!"
Forms("frmCloseRma").[Rma_Number].SetFocus
End If
End Sub
//code//
My question is how can I add the check if these fields are emty??
I would also like to have a msgbox if the RMA number is availible but the fields
are not emty.
Does anyone know how to make this work??
Martijn