Results 1 to 6 of 6
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: check if eof on form_current (2003)

    Try this:

    Private Sub Form_Current()
    Me.cmdWissen.Visible = (Me.CurrentRecord < Me.RecordsetClone.RecordCount)
    End Sub

  2. #2
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: check if eof on form_current (2003)

    That does not work.
    I have to say, I have also other code on form_current.
    I put my new code between it, but still it does not work:
    Dim db As DAO.Database
    Dim rst As DAO.Recordset
    Set db = CurrentDb
    Set rst = db.OpenRecordset("qrymaxnrfactuur", dbOpenDynaset)

    On Error GoTo form_Err
    Me.subFrmFacturatie.Form.AllowEdits = (Me.ynVoldaan = False)
    Me.subFrmFacturatie.Form.AllowAdditions = (Me.ynVoldaan = False)
    Me.subFrmFacturatie.Form.AllowDeletions = (Me.ynVoldaan = False)
    Forms!frmfacturatie!lblLocked = "Deze factuur kan niet bewerkt worden, daar ze reeds voldaan is!"
    Forms!frmfacturatie!cmdLocked.Visible = True
    If Me.ynVoldaan Then
    Forms!frmfacturatie!lblLocked = "Deze factuur kan niet bewerkt worden, daar ze reeds voldaan is!"
    Forms!frmfacturatie!cmdLocked.Visible = True
    ElseIf rst!factnr > Me.IDfactuur Then
    MsgBox rst!maxnr & "-" & Me.IDfactuur
    Me.cmdWissen.Visible = False

    Else
    MsgBox rst!maxnr & "-" & Me.IDfactuur
    Forms!frmfacturatie!lblLocked = ""
    Forms!frmfacturatie!cmdLocked.Visible = False

    End If
    rst.Close
    Set rst = Nothing
    Set db = Nothing
    form_End:
    Exit Sub
    form_Err:
    Resume form_End

    The message box shows that rst!factnr is bigger than me.idfactuur, so why does it not does the code?

  3. #3
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    check if eof on form_current (2003)

    Your code does not work, but I forgot to tell that I have already code there, so I put it between it.
    I have put this code and that works:
    Dim db As DAO.Database
    Dim rst As DAO.Recordset
    Set db = CurrentDb
    Set rst = db.OpenRecordset("qrymaxnrfactuur", dbOpenDynaset)

    On Error GoTo form_Err
    Me.subFrmFacturatie.Form.AllowEdits = (Me.ynVoldaan = False)
    Me.subFrmFacturatie.Form.AllowAdditions = (Me.ynVoldaan = False)
    Me.subFrmFacturatie.Form.AllowDeletions = (Me.ynVoldaan = False)
    Forms!frmfacturatie!lblLocked = "Deze factuur kan niet bewerkt worden, daar ze reeds voldaan is!"
    Forms!frmfacturatie!cmdLocked.Visible = True
    If Me.ynVoldaan Then
    Forms!frmfacturatie!lblLocked = "Deze factuur kan niet bewerkt worden, daar ze reeds voldaan is!"
    Forms!frmfacturatie!cmdLocked.Visible = True
    ElseIf rst!maxnr > Me.IDfactuur Then
    Me.cmdWissen.Visible = False
    Else
    Forms!frmfacturatie!lblLocked = ""
    Forms!frmfacturatie!cmdLocked.Visible = False
    End If
    rst.Close
    Set rst = Nothing
    Set db = Nothing
    form_End:
    Exit Sub
    form_Err:
    Resume form_End

    Now it works just fine.
    Thanks

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: check if eof on form_current (2003)

    Does this work better?

    ...
    ElseIf rst!factnr > Me.IDfactuur Then
    MsgBox rst!maxnr & "-" & Me.IDfactuur
    Me.cmdWissen.Visible = False
    Forms!frmfacturatie!lblLocked = ""
    Forms!frmfacturatie!cmdLocked.Visible = False
    Else
    MsgBox rst!maxnr & "-" & Me.IDfactuur
    Me.cmdWissen.Visible = True
    Forms!frmfacturatie!lblLocked = ""
    Forms!frmfacturatie!cmdLocked.Visible = False
    End If

  5. #5
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: check if eof on form_current (2003)

    Thanks that's it!
    I feel stuppid.
    thanks

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: check if eof on form_current (2003)

    No need to feel stupid! We all have had to learn! <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •