Results 1 to 2 of 2
  1. #1
    P5C768 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2009
    Location
    Denver, CO
    Posts
    95

    Setting a Default Value when RowSource is a Query

    Not sure if this should go in forms or queries...

    I have a list box that populates from a query after another field is updated. It appears that using the defualt value property and/or using an if statement to set the field does not work because it is based on a query. Is there a way to get around this?

    I would just like the field to display N/A if there are no results from the query.

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    So if there are no entries in the box after it is requeried, you want to show "N/A"?? I've never used a default value with a list box, but if there is one, you'll still have the box being displayed. I wonder if having a hidden textbox on the form would work better? Say, if the listcount of the box is 0, display the textbox, if not, hide the text and display the list.

    That may get you started. There are plenty of ideas that can spawn from that one.

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

Similar Threads

  1. VBA setting parameter to append query
    By rpiller in forum Programming
    Replies: 1
    Last Post: 09-30-2010, 04:02 PM
  2. Setting the Default Value and Proper Case Example
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-27-2010, 07:43 PM
  3. Replies: 0
    Last Post: 08-26-2009, 11:51 AM
  4. Setting default values in columns
    By crownedzero in forum Programming
    Replies: 0
    Last Post: 06-17-2009, 06:45 AM
  5. Setting default Unicode Compression when import from Excel
    By AndrewAfresh in forum Import/Export Data
    Replies: 0
    Last Post: 03-16-2009, 04:14 AM

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