Results 1 to 3 of 3
  1. #1
    tmartin is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Mar 2015
    Posts
    37

    Form Opens as a blank

    I have a search form that uses an Option Group, text boxes and a checkbox to gather information from the user that is used in a query for information.


    If I do a query and there are no results (Docmd.OpenForm(,,MyQuery,,)) , the split form windows opens as blank and the controls that I incorporated on the form(Edit and Close) are not visible.
    So I thought well maybe I should do a DLookup first to determine if a query returns null thereby returning control to the search form highlighting that no records were found. If the DLookup was not null then proceed with the DoCmd.OpenForm command.

    I am a novice to Access. Is there another way to resolve this problem?

    Tom

  2. #2
    tmartin is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Mar 2015
    Posts
    37
    Resolved the issue by using
    if DCount ("*","QueryName". Criteria) > 0
    If the count > 0, then go execute the DoCmd.OpenForm command

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    That's what I was just getting ready to suggest! As to the why...if a Form has no Records and New Records cannot be added (for whatever reason) the Form opens with nothing showing, not even the Controls, themselves!

    Linq ;0)>

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

Similar Threads

  1. Replies: 15
    Last Post: 07-24-2014, 09:45 AM
  2. Replies: 2
    Last Post: 03-17-2014, 09:01 AM
  3. Replies: 3
    Last Post: 09-27-2013, 07:56 AM
  4. Replies: 21
    Last Post: 08-05-2013, 06:23 AM
  5. Very strange issue: form opens blank
    By spleewars in forum Programming
    Replies: 5
    Last Post: 06-01-2012, 12:47 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