Results 1 to 8 of 8
  1. #1
    adaoluz is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2017
    Posts
    46

    Error in Form: FrmAberturaCaixa

    Hello friends!




    I have a form that makes the cash flow close, "FrmAberturaCaixa"


    when I try to do the closing happens "Error 2450 - being occurring in the form: frmbuscasaldoperiodo


    "Microsoft access can not find the form referenced 'frmbuscasaldoperiodo', and I have this form, this happens when I try to execute FrmAberturaCaixa, contece error. Who can help me by kindness


    Thank you very much in advance.
    Attached Files Attached Files

  2. #2
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,388
    Code:
    Private Sub bt_ok_Click()
       DoCmd.OpenForm "frmmostrasaldodia"
    End Sub
    You didn't explain the sequence of events to reproduce the error.
    I did find the above code that calls a form that does not exist...
    Last edited by davegri; 10-04-2018 at 10:00 PM. Reason: revision

  3. #3
    adaoluz is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2017
    Posts
    46
    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

  4. #4
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,388
    Code:
          X = DLast("[saldo do dia]", "qrysaldodia", "[data]= date()")
    It's because the query qrysaldodia is using criteria from form frmBuscasaldoperiodo, but the form is not open.

  5. #5
    adaoluz is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2017
    Posts
    46
    What could be done to not get this error again, please?

  6. #6
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,388
    What could be done to not get this error again, please?
    For the query to see anything on the form, the form must be open.
    I can't advise more as I can't follow the sequence of events that must occur for your logic to work because of the Italian.
    Good Luck.

  7. #7
    adaoluz is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2017
    Posts
    46
    Sorry the language is Portuguese, well I did several tests but I could not solve it yet, thank you.

  8. #8
    adaoluz is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2017
    Posts
    46
    Hello friends!


    follows the details my database is based on the opening of the box, release of the cash flow, ie releases the sales and the closing is the inhibition of sales, ie when you close the box will no longer be allowed sale in the day, only the next day it will be released and the box must contain the sales figures, values that you provide from an external source, (withdrawals) of some value and the cash balance.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 03-17-2016, 02:10 PM
  2. Replies: 14
    Last Post: 03-31-2015, 05:20 PM
  3. Replies: 1
    Last Post: 11-18-2014, 12:35 PM
  4. Replies: 10
    Last Post: 10-22-2013, 07:35 AM
  5. Replies: 0
    Last Post: 07-16-2012, 05:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums