Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Aug 2005
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    New record (Access 2000)

    I get errors when i try to press the button for a new record and i guess the reason is the on current event of the form, which calculates the liters for each customer, and for a new customer it is obvious that the liters will be non existent.How can i avoid this error ? In my attachment i have shown the liters only for one customer

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: New record (Access 2000)

    <P ID="edit" class=small>(Edited by patt on 28-May-06 09:12. Split line for format reasons on lounge)</P>Try this for your oncurrent event.
    <pre>Private Sub Form_Current()
    If Not Me.NewRecord Then
    Me.txtLiters.Visible = (Nz(DLookup("SumOfLiters", "qryLitersPerCustomer", _
    "CustomerID=" & [Customerid]), 0) > 0)
    End If
    End Sub
    </pre>


Posting Permissions

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