Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2010
    Location
    Yorkshire UK
    Posts
    76

    Unanswered: Runtime Error 2427

    I have a Form with 3 text boxes showing:

    txt1. Total Stock Figure
    txt2. SUM(Sales Orders Received). from a query
    txt3. Sum of 1 - 2

    So txt3 shows how many we have in stock minus how many have been ordered by customers but not yet despatched. (Free Stock)

    This works fine UNLESS there are no Sales Orders Received.

    Txt3 then shows "#error" within the text box.

    When i put a break into the onOpen event of the form, I put ? txt3 into the debug window and I get the following essage:

    RUNTIME 2427
    "You entered an expression that has no value"

    I have tried using nz(txt3,0) but this does not solve my problem. Can anyone help or do I need to give more details?

    Thanks
    Simon

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    I think you need to use the Nz() function for Sales Orders Received

    txt3 = txt1 - Nz(txt2, 0)

    rather than for txt3.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    Feb 2010
    Location
    Yorkshire UK
    Posts
    76
    Tried this as well but no joy.

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    If the sum is coming from a subform:

    Forms: #Error when the Subform has no records
    Paul

  5. #5
    Join Date
    Feb 2010
    Location
    Yorkshire UK
    Posts
    76
    That has got it. Thanks

Posting Permissions

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