Como conseguir mensajes correlativos según campos vacíos
Y aprendices!
Necesito crear una serie de mensajes correlativos en vba al hacer click en el botón guardar. El problema es que no me funciona. El código es el siguiente:
Private Sub cmdGuardarObra_Click()
Dim respuesta As Integer
respuesta = MsgBox("¿Desea guardar esta obra?" + vbLf + vbLf + "x: " + Me.x+ vbLf + "y: " + Me.y, vbYesNo, " Guardar datos")
If respuesta = vbYes Then
If Me.w= "" Then
MsgBox "Por favor, rellene el campo de w.", vbOKOnly, " Faltan datos"
End If
If Me.x= "" Then
MsgBox "Por favor, rellene el campo de x.", vbOKOnly, " Faltan datos"
End If
If Me.y= "" Then
MsgBox "Por favor, rellene el campo de y.", vbOKOnly, " Faltan datos"
End If
If Me.z= "" Then
MsgBox "Por favor, rellene el campo de z.", vbOKOnly, " Faltan datos"
End If
If Me.ID = 0 Then
Me.ID = DMax("ID", "tabla") + 1
DoCmd.RunCommand acCmdSave
End If
Else
MsgBox "La obra no se ha guardado.", vbOKOnly, " Cambios no guardados"
End If
End SubEspero que se pueda entender fácil y que me podáis ayudar.
Respuesta de Julián González Cabarcos
2








