none
Navigation Where Clause

    Question

  • Hi There,

    I'm using the following code to open a Navigation Form:

    CODE

    If IsNull(Me!ID) = False Then
    DoCmd.OpenForm "frmClaims", , , "[ID]= " & Me!ID
    End If



    It works fine. Now, the NavigationSubform is not loading the ID data.

    By doing some research if find out that using the “Navigation Where Clause” is loads the ID data.

    I entered as follow:

    ID = Me!ID

    But when I run the form it ask for the ID Number, when I enter the ID number it loads everything just fine.

    So I figure that I was doing something wrong with the Clause

    Can someone help me with how to use the “Navigation Where Clause”?

    Thanks a lot.


    Thanks for everything, all your help is well appreciated
    Monday, July 04, 2011 6:31 PM

Answers

  • When you say a navigation form do you mean in general terms you using some form for navigation, or are you using the new access 2010 navigation system? There is quite a difference between the two terms.

    If you are using a navigation form, then you'll be using the browseto command, since open form would be opening a whole new form.

    Often people just call any old form a navigation form, but in access 2010 it has a specific meaning and context, and without this proper context in the answers and feedback you're getting from posters here will not be applicable to your actual problem and question.

    Also as a general rule, to my knowledge that the full name for the navigation form is certainly not frmClaims, but is Usually defaulted to "Navigation Form".

    So when you say you're opening a navigation form, is this navigation form called frmClaims, or are in fact are you actually using a real access 2010 navigation form?

    Normally if you open a navigation form, it's going to have a set of nav controls and forms assigned to those controls - when you select one of those controls, an object called Navagationsubform will display the form in question.

     
    Albert D. Kallal  (Access MVP)
    Edmonton, Alberta Canada

    • Marked as answer by scorpdevil Wednesday, July 27, 2011 4:49 PM
    Monday, July 04, 2011 7:19 PM
  • Hello Scorpdevil,

    I'm happy to see you again in our forum!

     

    If IsNull(Me!ID) = False Then

     DoCmd.OpenForm "frmClaims", , , "[ID]= " & Me!ID

     End If

     

    Now I couldn’t tell what's wrong with your code exactly with the short code.

     

    First I want to suggest you making sure that you have set the Control Source of the frmClaims to the corresponding table.

     

    Then you can try this:

    DoCmd.OpenForm "frmClaims", , , "[ID]= " & Me.ID.Value

     

    Also, you can try Danishani’s idea.

    Use DoCmd.BrowseTo command on your side.

     

    At last I want to give you another suggestion which you can use as reference.

     

    You may want to use the OpenArgs parameter to send the parameter, and then let the Open method on your target form use the OpenArgs to create a filter. Remember to set FilterOn = True.

     

    I hope this will be helpful for you.

    If you have any other problems or I misunderstood anything, please feel free to talk about them with us.

     

    Best Regards,


    Macy Dong [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by scorpdevil Wednesday, July 27, 2011 4:49 PM
    Thursday, July 07, 2011 5:24 AM

All replies

  • Hi there,

    Why not link your Subform to your Mainform with Link Master Fields and Link Child Fields?

     

    See this thread for reference:

    http://www.fmsinc.com/microsoftaccess/forms/Subform/Master-Link-Fields.asp

     

    HTH,


    Daniel van den Berg | Washington, USA | "Anticipate the difficult by managing the easy"
    Monday, July 04, 2011 6:38 PM
  • Daniel,

    Sorry but i don't see that option on the NavigationSubform properties


    Thanks for everything, all your help is well appreciated
    Monday, July 04, 2011 6:57 PM
  • When you say a navigation form do you mean in general terms you using some form for navigation, or are you using the new access 2010 navigation system? There is quite a difference between the two terms.

    If you are using a navigation form, then you'll be using the browseto command, since open form would be opening a whole new form.

    Often people just call any old form a navigation form, but in access 2010 it has a specific meaning and context, and without this proper context in the answers and feedback you're getting from posters here will not be applicable to your actual problem and question.

    Also as a general rule, to my knowledge that the full name for the navigation form is certainly not frmClaims, but is Usually defaulted to "Navigation Form".

    So when you say you're opening a navigation form, is this navigation form called frmClaims, or are in fact are you actually using a real access 2010 navigation form?

    Normally if you open a navigation form, it's going to have a set of nav controls and forms assigned to those controls - when you select one of those controls, an object called Navagationsubform will display the form in question.

     
    Albert D. Kallal  (Access MVP)
    Edmonton, Alberta Canada

    • Marked as answer by scorpdevil Wednesday, July 27, 2011 4:49 PM
    Monday, July 04, 2011 7:19 PM
  • Hi again,

    I think you are using Access 2010, I am not that familiar with this, so hopefully someone else will step in.

     

    You might try this thread here:

    http://office.microsoft.com/en-us/access-help/create-a-form-that-contains-a-subform-HA101872705.aspx#_Toc271094119

     

    HTH,


    Daniel van den Berg | Washington, USA | "Anticipate the difficult by managing the easy"
    Monday, July 04, 2011 7:20 PM
  • Thanks Daniel,

    Albert i strongly believe it all related to "Navigation Where Clause"


    Thanks for everything, all your help is well appreciated
    Monday, July 04, 2011 8:33 PM
  • Hi again,

     

    This is what Albert refers to, see simular thread, just in case you are interested:

    http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/a4eeb757-152e-4d19-a685-f377a242adf4/

     

    HTH,


    Daniel van den Berg | Washington, USA | "Anticipate the difficult by managing the easy"
    Tuesday, July 05, 2011 1:03 AM
  • Hello Scorpdevil,

    I'm happy to see you again in our forum!

     

    If IsNull(Me!ID) = False Then

     DoCmd.OpenForm "frmClaims", , , "[ID]= " & Me!ID

     End If

     

    Now I couldn’t tell what's wrong with your code exactly with the short code.

     

    First I want to suggest you making sure that you have set the Control Source of the frmClaims to the corresponding table.

     

    Then you can try this:

    DoCmd.OpenForm "frmClaims", , , "[ID]= " & Me.ID.Value

     

    Also, you can try Danishani’s idea.

    Use DoCmd.BrowseTo command on your side.

     

    At last I want to give you another suggestion which you can use as reference.

     

    You may want to use the OpenArgs parameter to send the parameter, and then let the Open method on your target form use the OpenArgs to create a filter. Remember to set FilterOn = True.

     

    I hope this will be helpful for you.

    If you have any other problems or I misunderstood anything, please feel free to talk about them with us.

     

    Best Regards,


    Macy Dong [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by scorpdevil Wednesday, July 27, 2011 4:49 PM
    Thursday, July 07, 2011 5:24 AM