Hi people,
As you can see in the attached file, there is no code but the form is still there and if you try to open the vba window from the form you cannot see it.
I had something like that inside the form: (it's a piece of the code)
Private Sub cmdsalvar_Click()
On Error GoTo Err_cmdsalvar_Click
If IsNull(Nome.Value) Then
MsgBox "O campo Nome obrigatório!", vbCritical
Nome.SetFocus
Exit Sub
End If
DoCmd.GoToRecord , , acNewRec
Exit_cmdsalvar_Click:
hide
MsgBox "Dados gravados com sucesso", vbInformation
DoCmd.Close , , acSaveNo
Exit Sub
Err_cmdsalvar_Click:
MsgBox Err.Description
Resume Exit_cmdsalvar_Click
End Sub
Private Sub cmd_Click()
If Not IsNull(DLookup("perfil", "user", "numero = " & Me.txtnumero)) Then
a = DLookup("perfil", "user", "numero = " & Me.txtnumero)
Numero.SetFocus
Numero.Text = Me.txtnumero
Else
On Error GoTo Err_cmd_Click
DoCmd.GoToRecord , , acNewRec
Exit_cmd_Click:
Exit Sub
Err_cmd_Click:
MsgBox Err.Description
Resume Exit_cmd_Click
End If
End Sub
Private Sub cmdverifica_Click()
If IsNull(txtverifica) Then
MsgBox "O número da conta não pode ser nulo", vbCritical
txtverifica.SetFocus
Exit Sub
ElseIf Len(txtverifica.Value) <> 20 Then
MsgBox "Conta inválida! a conta deve conter 20 dígitos!", vbCritical
txtverifica.SetFocus
Exit Sub
End If
Dim Nome As String
If Not IsNull(DLookup("nome", "contas", "conta = " & Str(Me.txtverifica))) Then
Nome = DLookup("nome", "contas", "conta = " & Me.txtverifica)
subform.Visible = True
disabled
lbl2.Caption = Nome
regra1
Else
DoCmd.GoToRecord , "Contas_Segmentation", acNewRec
On Error GoTo Err_cmdverifica_Click
show
Conta.SetFocus
'Criar uma function para isso
Conta.Text = txtverifica.Value
cmdsalvar.Visible = True
cmdcancelar.Visible = True
Funcionalidade.SetFocus
Conta.enabled = False
txtverifica.enabled = False
cmdverifica.enabled = False
Exit_cmdverifica_Click:
Exit Sub
Err_cmdverifica_Click:
MsgBox Err.Description
Resume Exit_cmdverifica_Click
Exit Sub
cmdverifica_Click:
MsgBox Err.Description
Exit Sub
End If
End Sub
Rgds,