Hello !
sorry missed the details
well the error happens when you open the form: "FrmAberturaCaixa"
the "run-time error 2450, microsoft access can not find the form referenced" frmbuscasaldoperiodo ",
the error is occurring on the next highlighted red line.
Code:
Private Sub Bt_FecharCaixa_Click() Dim sSQL As String
'On Error Resume Next
If IsNull(Me.FechaValor) Or Me.FecharData = "" Then
MsgBox " Data Fechamento é campo obrigatório !", vbCritical, Me.Caption
Else
Dim X As Variant
X = DLast("[saldo do dia]", "qrysaldodia", "[data]= date()")
If MsgBox("Deseja fechar o caixa com o saldo de: " & FormatCurrency(X), vbYesNo, Me.Caption) = vbNo Then
Me.Undo
DoCmd.CancelEvent
Exit Sub
Else
sSQL = "INSERT INTO TblSaldo ( Data, Descricao, ValorSalda)" & _
" VALUES (#" & Format(Me.CaixaData, "mm/dd/yyyy") & "#, 'Fechamento Caixa com o saldo de: " & FormatCurrency(Me.CaixaValor) & "', " & Me.FechaValor & ")"
Debug.Print sSQL
DoCmd.RunSQL sSQL
MsgBox " Caixa Fechado ! ", vbInformation, Me.Caption
End If
End If
Forms!Frmmenu.Visible = True
DoCmd.Close acForm, Me.Name
End Sub