Results 1 to 4 of 4
  1. #1
    quicova is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2013
    Posts
    53

    if Form is closed ignore Query criteria

    Hi everyone.

    I have 1 query used in two identical forms.
    All the comboboxs of both forms are the same, and used as criteria for the query



    but If i have one of the forms closed I get a pop out box asking for the criteria value of the closed form.

    It is also happening when I add that form to a navigation form. Every time I switch from form to form it pops out the criteria window.

    on the criteria I'm using Like "*" & [Forms]![MyForm1]![combo1] & "*"

    Any idea on how to ignore the criteria pop out box?
    Thanks so much

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Not with a dynamic parameterized query. That is one of their drawbacks and one reason I don't use. I use VBA to set form and report filters. I think macros have equivalent.

    Why do you have two identical forms? Each form will need its own query. Can construct query directly in the RecordSource property, doesn't have to be reference to saved query object.

    Is this a web database?

    I don't use or like navigation forms because they seem to make this sort of code really hard if not impossible.

    Check if form is loaded:
    If CurrentProject.AllForms("form name").IsLoaded Then
    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
    quicova is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2013
    Posts
    53
    It is hard to explain why 2 forms.
    basically on is to add items to a list, the other is to edit those item.
    If I knew more about access for sure I think you could just use one form. but this will also work.
    It is a huge fail that you can't ignore those errors.

    Yeah I think the nav form will suck, but I don't see any other why. I cant having the user using the normal navigation window.
    If I can't fix this one, the Nav form will not work and I'm screwed.

    you saying to put that if statement in the criteria on the query?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    No, that If statement is VBA code. Not really relevant to your issue and I probably should not have posted it.

    A single form should work for both new records as well as to edit existing.

    Users should never interact with the Navigation pane but a navigation form does not prevent users getting to navigation pane. Normal forms and code (macro or VBA) can offer similar interface as navigation form but easier to code.
    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.

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

Similar Threads

  1. Criteria Needs to Ignore Weekends
    By RichardAnderson in forum Queries
    Replies: 41
    Last Post: 08-30-2013, 08:22 AM
  2. Replies: 1
    Last Post: 03-28-2013, 07:54 AM
  3. Form not getting closed at first time
    By vikasbhandari2 in forum Programming
    Replies: 10
    Last Post: 07-20-2012, 01:25 PM
  4. Ignore blank on query expression.
    By zero3ree in forum Access
    Replies: 3
    Last Post: 06-11-2012, 11:22 AM
  5. Replies: 4
    Last Post: 08-17-2011, 05:30 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