F
Fred
hi... i want this code record fields(nome,IPCMref and POTdec),only with is
not exist in table...the problem is that code record fields, when this
fields 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
thanks
Fred
not exist in table...the problem is that code record fields, when this
fields 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
thanks
Fred