Results 1 to 3 of 3
  1. #1
    JBLoafer is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2011
    Location
    Lincoln UK
    Posts
    11

    Trap missing query field in a bound object to make filed not visible


    I have a form that I'm trying to make universal so I don't have to keep redesigning it. Typically it shows the 7 days of a week for a series of events that take place every year. However the days change from year to year. If there is a missing field in the underlying the query, Access displays "Name" in the bound text box. I would like to trap this message and instead make the box invisible. Seems like I need some On Open code for the form but how do I intercept the error(s) that access detects? As there are presently 12 events and therefore 84 members of the grid, a bit of code shrinking might be useful too.
    This is for aesthetics as well as letting the user focus on the only allowed days.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Is a CROSSTAB query involved?

    Making the box 'invisible' will not compress the space. There will still be a blank spot where the box sits. Can try to not show the error, never tried:

    =IIf(IsError([fieldname]),Null,[fieldname])
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    JBLoafer is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2011
    Location
    Lincoln UK
    Posts
    11

    Red face

    Quote Originally Posted by June7 View Post
    Is a CROSSTAB query involved?

    Making the box 'invisible' will not compress the space. There will still be a blank spot where the box sits. Can try to not show the error, never tried:

    =IIf(IsError([fieldname]),Null,[fieldname])
    June7
    Thanks a deal for a quick response. I've tried your suggested code but using an unbound text box and it does work.
    Re your concern about compressing the space, I really want to have all the real responses in their proper place in the grid. All I need to do now is to set the text box background to the form background so it is invisible to the user. I'll try doing that using conditional format, as I have done that on other forms.
    so with a bit of luck, job done, and thanks very much for the tip on recognising the right word to trap the deliberately missing query field.

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

Similar Threads

  1. Replies: 6
    Last Post: 08-22-2013, 05:35 AM
  2. Replies: 1
    Last Post: 04-26-2013, 05:30 PM
  3. Replies: 1
    Last Post: 01-15-2012, 05:05 PM
  4. Replies: 1
    Last Post: 09-03-2011, 07:01 PM
  5. Replies: 1
    Last Post: 08-05-2010, 12:11 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