F
Fred
hi... i want this code record fields(name,IPCMref and POTdec),only with value
of fields is not exist in table...the problem is that code record fields
when this
exist in table.
Other problem is the button cancel in the msgbox, I
want this button cancel return to the form without record..but this not
happening.
the code is:
nome.SetFocus
If nome.Text = "" Then
MsgBox "Necessita de preencher todos os campos.", vbInformation
Else
If IPCMref2.Value = "" Then
MsgBox "Necessita de preencher todos os campos.", vbInformation
Else
If POTdec2.Value = "" Then
MsgBox "Necessita de preencher todos os campos.", vbInformation
Else
If Me.[nome] = DLookup("[Nome do Parque]", "[Consulta_parque]") Then
MsgBox "O Parque já se encontra adicionado.", vbInformation
Else
If MsgBox("Deseja adicionar o Parque?", vbQuestion + vbOKCancel) = vbCancel
Then
Cancel = True
Else
If Me.Dirty Then Me.Dirty = False
DoCmd.RunCommand acCmdRecordsGoToNew
DoCmd.Close
DoCmd.OpenForm "input"
DoCmd.Close
DoCmd.OpenForm "apresentacao", acNormal
end if
end if
end if
end if
thanks
Fred
of fields is not exist in table...the problem is that code record fields
when this
exist in table.
Other problem is the button cancel in the msgbox, I
want this button cancel return to the form without record..but this not
happening.
the code is:
nome.SetFocus
If nome.Text = "" Then
MsgBox "Necessita de preencher todos os campos.", vbInformation
Else
If IPCMref2.Value = "" Then
MsgBox "Necessita de preencher todos os campos.", vbInformation
Else
If POTdec2.Value = "" Then
MsgBox "Necessita de preencher todos os campos.", vbInformation
Else
If Me.[nome] = DLookup("[Nome do Parque]", "[Consulta_parque]") Then
MsgBox "O Parque já se encontra adicionado.", vbInformation
Else
If MsgBox("Deseja adicionar o Parque?", vbQuestion + vbOKCancel) = vbCancel
Then
Cancel = True
Else
If Me.Dirty Then Me.Dirty = False
DoCmd.RunCommand acCmdRecordsGoToNew
DoCmd.Close
DoCmd.OpenForm "input"
DoCmd.Close
DoCmd.OpenForm "apresentacao", acNormal
end if
end if
end if
end if
thanks
Fred