Results 1 to 4 of 4
  1. #1
    dakwest is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2009
    Posts
    2

    Error in field

    I have two queries and have setup a relationship between the two. Q1 has several thousand records. Q2 has about 1000 records. There is only one record in Q2 that relates to a record in Q1. I want to create a Third Query that contains only a few fields from each of the first two queries. The problem is that when I create a field to contain data from Q2, if there is no record found, this field contains "#error". I would like to have the field contain nothing. I cannot seem to figure this out. Help would be appreciated.
    Thanks

  2. #2
    CGM3 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Atlanta, GA
    Posts
    49
    The code for the queries would be helpful to find the problem. And does the "#error" show up in the query, or a report using the query as its source? If the latter, you can use this formula in the text field--

    =IIf(IsError([field]),"",[field])

    --where "field" is the field involved.

  3. #3
    dakwest is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2009
    Posts
    2
    The #error shows up in the Query I am trying to create. In this Query, I am creating an expression called "Size". I want the data to come from the field "Net2Price" in Q2. Since not all records in Q1 have a related record in Q2, the error is generated for the records with no match. The formula I tried is this:

    Size: iif(iserror(Net2Price),0,Net2price)

    In the records that match, Size is value of Net2Price, but in the fields where there is no match, I get "#error". I want instead to have this value at 0.

  4. #4
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    It sounds like you are attempting to calculate a figure based on entities from two different queries. However if one side of the equasion is missing then you will get an error - as expected.

    X- Nothing = Error
    X-0 = X

    Therefore in each of your queries you need to ensure that no Null or Blank fields are returned.

    David

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Autofill field based on autonumber field
    By frevilla in forum Forms
    Replies: 1
    Last Post: 09-11-2009, 02:50 AM
  2. Replies: 1
    Last Post: 07-21-2009, 03:01 PM
  3. Replies: 1
    Last Post: 02-26-2009, 11:31 AM
  4. Quick way to stuff field names into text field
    By kfinpgh in forum Programming
    Replies: 0
    Last Post: 01-04-2007, 01:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums