Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Coding problem (A2k SP3)

    I have a frmCustomerEntry that has a command button CheckIn. The checkIn button opens frmCheckIn. Everything works OK until the AfterUpdate event in Combo Box PayID captioned Payment Method.

    The offending code line is Me.[Invoiced] = -1. Invoiced is a Yes/No field in tblCustomers. If the PayID field is 7 (Invoiced) or 9 (PastDue), I want the Invoiced field in tblCustomer to be set to

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Coding problem (A2k SP3)

    First of all, check your query qryRentCalc0. You have 3 times a field named Invoiced. And other fields are also duplicated.
    For the code, when you are adding a record, the key field to the table tblCustomers is not yet set in the table tblrental. You have to save the record first.
    If you add the field Invoiced (after cleaning up the query) to the form, use the following code to modify it.<pre>Private Sub PayID_AfterUpdate()
    DoCmd.RunCommand acCmdSaveRecord
    If Me.[PayID] = 7 Or Me.[PayID] = 9 Then
    Me.[AccountReceivable] = -1
    Me.[OrigARDate] = Me.[RentPaidDate]
    Me.[Invoiced] = -1
    Else
    Me.[AccountReceivable] = 0
    Me.[OrigARDate] = Null
    End If
    End Sub</pre>

    Francois

  3. #3
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Coding problem (A2k SP3)

    Many thanks for your assistance. I was able to clean up rentCalc0 and apply your code.

    Tom

Posting Permissions

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