Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    Oct 2003
    Guelph, Ontario, Canada
    Thanked 0 Times in 0 Posts

    Null values in Invoice form (Access 2000 all updates)

    I have an Invoice form. The main part of the form contains basic information about the person being invoiced. Then there are 2 subforms.

    frmInvoiceSub ... in which services are entered. There are 4 controls.
    cboService, in which the user can select any 1 of 10 items
    Rate, which is entered automatically depending on the Service selected in cboService
    Qty, the default for which is 1
    txtCost, a calculated control (=[Rate] * [Qty])
    There can be several services entered in the same invoice.

    frmInvCreditSub ... in which Credits, if any, are entered (for partial rebate of service cost etc.) There are 4 controls.
    txtItem, a text box stating reason for Credit
    Rate, a currency field entered manually
    Qty, the default for which is 1
    txtCost, a calculated control (=[Rate] * [Qty])

    The bottom part of the Invoice pulls totals from Services and Credits, calculates applicable taxes, and then a Total for the Invoice. I have code to deal with $0.00 invoices, and that works.

    The trouble is that, occasionally, the user manages to enter into either the Services or the Credits subform, starts to enter something and then exits...leaving, in fact, a Null value in one of the subforms. This creates a problem with queries that calculate balances owing reports for the individual.

    Actually, I can deal with the problem by setting Criteria of "Is Not Null" in the queries that populate the reports. However, it would make far more sense to inhibit the Null values at the form level.

    I have tried to put code on the BeforeUpdate, and OnExit, events for the controls in question. I have also tried to put code on the form's BeforeUpdate event. But I can't seem to get anything to work satisfactorily.

    Any ideas would be appreciated.


  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Null values in Invoice form (Access 2000 all updates)

    At the table level, you can set the Required property of a field to Yes. Once the user has started to enter something in a record, fields with Required = Yes cannot be left blank (null). The user must either fill in a value, or cancel the record altogether.

Posting Permissions

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