Move to another record via combobox doesn't work in some circumstancesRefresh/Requery Combobox problemsAccess subform not refreshing displayed recordsUnable to requery a subform A, which has the source object Form A, from a separate subform B, unless Form A is opened firstRequery only one record in a datasheet view form (MS Access)How to requery form opened by another userMS Access Refresh and Requery won't work in Form with Combo Box to select recordsWhat event happens when Requerying ListBox?Requery form after relinking tablesCannot refresh subform from other subformAccess. How to Create a record and select that record in CBO on another form?

Why was Germany not as successful as other Europeans in establishing overseas colonies?

Applying a function to a nested list

Survey Confirmation - Emphasize the question or the answer?

Was Hulk present at this event?

How to efficiently calculate prefix sum of frequencies of characters in a string?

What happened to Rhaegal?

Can I use 1000v rectifier diodes instead of 600v rectifier diodes?

If an enemy is just below a 10-foot-high ceiling, are they in melee range of a creature on the ground?

How do you center multiple equations that have multiple steps?

What was the state of the German rail system in 1944?

Is it cheaper to drop cargo than to land it?

Binary Numbers Magic Trick

Would "lab meat" be able to feed a much larger global population

Why do freehub and cassette have only one position that matches?

Why is Thanos so tough at the beginning of "Avengers: Endgame"?

Accidentally deleted the "/usr/share" folder

If 1. e4 c6 is considered as a sound defense for black, why is 1. c3 so rare?

Packet sniffer for MacOS Mojave and above

Is there a QGIS plugin that reclassify raster symbology based on current extent?

An 'if constexpr branch' does not get discarded inside lambda that is inside a template function

How did Arya manage to disguise herself?

A non-technological, repeating, phenomenon in the sky, holding its position in the sky for hours

Copy line and insert it in a new position with sed or awk

I’ve officially counted to infinity!



Move to another record via combobox doesn't work in some circumstances


Refresh/Requery Combobox problemsAccess subform not refreshing displayed recordsUnable to requery a subform A, which has the source object Form A, from a separate subform B, unless Form A is opened firstRequery only one record in a datasheet view form (MS Access)How to requery form opened by another userMS Access Refresh and Requery won't work in Form with Combo Box to select recordsWhat event happens when Requerying ListBox?Requery form after relinking tablesCannot refresh subform from other subformAccess. How to Create a record and select that record in CBO on another form?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I have two forms: ‘frmClient’, (which has a subform that lists applicants), and ‘frmDisclosure’, which shows details of applicants. On frmClient there is a command button that opens a specified record in frmDisclosure. The procedure is Private Sub Command10_Click() - see below. This works.



The problem is that once in frmDisclosure via frmClient, it is not possible to move to another record. The procedure for opening another record in frmDiscloure is in a combobox control: Private Sub ComboFind_AfterUpdate().
This normally works, but it never works if frmDiscloure has been opened via frmClient. I have tried ‘requery’ and ‘refresh’ in various situations, and have tried closing frmClient once frmDisclosure is open. None of this works. If I want to get to a different record, the only solution I have at present is to close frmDisclosure and reopen it.



\\\\\\\\\\\\\\
Private Sub Command10_Click()
If NumForms > 0 Then
DoCmd.OpenForm "frmDisclosure"
Forms!frmDisclosure.FilterOn = False
DoCmd.OpenForm "frmDisclosure", acNormal, "", "[DiscPK]=" & Me.DiscPK, , acNormal
Else
DisplayMessage ("No form ref for this application.")
Exit Sub
End If
End Sub
\\\\\\\\\\\\\\\\

\\\\\\\\\\\\\\\\
Private Sub ComboFind_AfterUpdate()
Dim rs As Object
Set rs = Me.RecordsetClone
rs.FindFirst "[DiscPK] = " & Str(Nz(Me![ComboFind], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
\\\\\\\\\\\\\\\\









share|improve this question



















  • 1





    frmDisclosure is opened to a single record, there are no other records to navigate. The RecordsetClone has only one record, so of course code won't find any others. Try clearing the filter first: Me.FilterOn = False. If DiscPK is a number type, why do you convert parameter to string?

    – June7
    Mar 22 at 20:39












  • Thanks. Putting filteron= false in the before update event of the combox box results in runtime error 2115 - it is preventing Access from saving data in the field. When typing the whre condition, I was 'on autopilot' - done it that way so often that I don't think. I'll re- do is a number.

    – Great Crosby
    Mar 22 at 21:07











  • Reworking the parameter as number makes no difference.

    – Great Crosby
    Mar 22 at 21:12











  • I hadn't realised that frmDisclosure is opened to a single record, there are no other records to navigate. Could be the clue that I need.

    – Great Crosby
    Mar 22 at 21:13











  • I expect "[DiscPK]=" & Me.DiscPK is restricting to one record.

    – June7
    Mar 22 at 21:18

















0















I have two forms: ‘frmClient’, (which has a subform that lists applicants), and ‘frmDisclosure’, which shows details of applicants. On frmClient there is a command button that opens a specified record in frmDisclosure. The procedure is Private Sub Command10_Click() - see below. This works.



The problem is that once in frmDisclosure via frmClient, it is not possible to move to another record. The procedure for opening another record in frmDiscloure is in a combobox control: Private Sub ComboFind_AfterUpdate().
This normally works, but it never works if frmDiscloure has been opened via frmClient. I have tried ‘requery’ and ‘refresh’ in various situations, and have tried closing frmClient once frmDisclosure is open. None of this works. If I want to get to a different record, the only solution I have at present is to close frmDisclosure and reopen it.



\\\\\\\\\\\\\\
Private Sub Command10_Click()
If NumForms > 0 Then
DoCmd.OpenForm "frmDisclosure"
Forms!frmDisclosure.FilterOn = False
DoCmd.OpenForm "frmDisclosure", acNormal, "", "[DiscPK]=" & Me.DiscPK, , acNormal
Else
DisplayMessage ("No form ref for this application.")
Exit Sub
End If
End Sub
\\\\\\\\\\\\\\\\

\\\\\\\\\\\\\\\\
Private Sub ComboFind_AfterUpdate()
Dim rs As Object
Set rs = Me.RecordsetClone
rs.FindFirst "[DiscPK] = " & Str(Nz(Me![ComboFind], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
\\\\\\\\\\\\\\\\









share|improve this question



















  • 1





    frmDisclosure is opened to a single record, there are no other records to navigate. The RecordsetClone has only one record, so of course code won't find any others. Try clearing the filter first: Me.FilterOn = False. If DiscPK is a number type, why do you convert parameter to string?

    – June7
    Mar 22 at 20:39












  • Thanks. Putting filteron= false in the before update event of the combox box results in runtime error 2115 - it is preventing Access from saving data in the field. When typing the whre condition, I was 'on autopilot' - done it that way so often that I don't think. I'll re- do is a number.

    – Great Crosby
    Mar 22 at 21:07











  • Reworking the parameter as number makes no difference.

    – Great Crosby
    Mar 22 at 21:12











  • I hadn't realised that frmDisclosure is opened to a single record, there are no other records to navigate. Could be the clue that I need.

    – Great Crosby
    Mar 22 at 21:13











  • I expect "[DiscPK]=" & Me.DiscPK is restricting to one record.

    – June7
    Mar 22 at 21:18













0












0








0








I have two forms: ‘frmClient’, (which has a subform that lists applicants), and ‘frmDisclosure’, which shows details of applicants. On frmClient there is a command button that opens a specified record in frmDisclosure. The procedure is Private Sub Command10_Click() - see below. This works.



The problem is that once in frmDisclosure via frmClient, it is not possible to move to another record. The procedure for opening another record in frmDiscloure is in a combobox control: Private Sub ComboFind_AfterUpdate().
This normally works, but it never works if frmDiscloure has been opened via frmClient. I have tried ‘requery’ and ‘refresh’ in various situations, and have tried closing frmClient once frmDisclosure is open. None of this works. If I want to get to a different record, the only solution I have at present is to close frmDisclosure and reopen it.



\\\\\\\\\\\\\\
Private Sub Command10_Click()
If NumForms > 0 Then
DoCmd.OpenForm "frmDisclosure"
Forms!frmDisclosure.FilterOn = False
DoCmd.OpenForm "frmDisclosure", acNormal, "", "[DiscPK]=" & Me.DiscPK, , acNormal
Else
DisplayMessage ("No form ref for this application.")
Exit Sub
End If
End Sub
\\\\\\\\\\\\\\\\

\\\\\\\\\\\\\\\\
Private Sub ComboFind_AfterUpdate()
Dim rs As Object
Set rs = Me.RecordsetClone
rs.FindFirst "[DiscPK] = " & Str(Nz(Me![ComboFind], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
\\\\\\\\\\\\\\\\









share|improve this question
















I have two forms: ‘frmClient’, (which has a subform that lists applicants), and ‘frmDisclosure’, which shows details of applicants. On frmClient there is a command button that opens a specified record in frmDisclosure. The procedure is Private Sub Command10_Click() - see below. This works.



The problem is that once in frmDisclosure via frmClient, it is not possible to move to another record. The procedure for opening another record in frmDiscloure is in a combobox control: Private Sub ComboFind_AfterUpdate().
This normally works, but it never works if frmDiscloure has been opened via frmClient. I have tried ‘requery’ and ‘refresh’ in various situations, and have tried closing frmClient once frmDisclosure is open. None of this works. If I want to get to a different record, the only solution I have at present is to close frmDisclosure and reopen it.



\\\\\\\\\\\\\\
Private Sub Command10_Click()
If NumForms > 0 Then
DoCmd.OpenForm "frmDisclosure"
Forms!frmDisclosure.FilterOn = False
DoCmd.OpenForm "frmDisclosure", acNormal, "", "[DiscPK]=" & Me.DiscPK, , acNormal
Else
DisplayMessage ("No form ref for this application.")
Exit Sub
End If
End Sub
\\\\\\\\\\\\\\\\

\\\\\\\\\\\\\\\\
Private Sub ComboFind_AfterUpdate()
Dim rs As Object
Set rs = Me.RecordsetClone
rs.FindFirst "[DiscPK] = " & Str(Nz(Me![ComboFind], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
\\\\\\\\\\\\\\\\






ms-access access-vba






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 22 at 20:31









June7

5,72451227




5,72451227










asked Mar 22 at 20:06









Great CrosbyGreat Crosby

1033




1033







  • 1





    frmDisclosure is opened to a single record, there are no other records to navigate. The RecordsetClone has only one record, so of course code won't find any others. Try clearing the filter first: Me.FilterOn = False. If DiscPK is a number type, why do you convert parameter to string?

    – June7
    Mar 22 at 20:39












  • Thanks. Putting filteron= false in the before update event of the combox box results in runtime error 2115 - it is preventing Access from saving data in the field. When typing the whre condition, I was 'on autopilot' - done it that way so often that I don't think. I'll re- do is a number.

    – Great Crosby
    Mar 22 at 21:07











  • Reworking the parameter as number makes no difference.

    – Great Crosby
    Mar 22 at 21:12











  • I hadn't realised that frmDisclosure is opened to a single record, there are no other records to navigate. Could be the clue that I need.

    – Great Crosby
    Mar 22 at 21:13











  • I expect "[DiscPK]=" & Me.DiscPK is restricting to one record.

    – June7
    Mar 22 at 21:18












  • 1





    frmDisclosure is opened to a single record, there are no other records to navigate. The RecordsetClone has only one record, so of course code won't find any others. Try clearing the filter first: Me.FilterOn = False. If DiscPK is a number type, why do you convert parameter to string?

    – June7
    Mar 22 at 20:39












  • Thanks. Putting filteron= false in the before update event of the combox box results in runtime error 2115 - it is preventing Access from saving data in the field. When typing the whre condition, I was 'on autopilot' - done it that way so often that I don't think. I'll re- do is a number.

    – Great Crosby
    Mar 22 at 21:07











  • Reworking the parameter as number makes no difference.

    – Great Crosby
    Mar 22 at 21:12











  • I hadn't realised that frmDisclosure is opened to a single record, there are no other records to navigate. Could be the clue that I need.

    – Great Crosby
    Mar 22 at 21:13











  • I expect "[DiscPK]=" & Me.DiscPK is restricting to one record.

    – June7
    Mar 22 at 21:18







1




1





frmDisclosure is opened to a single record, there are no other records to navigate. The RecordsetClone has only one record, so of course code won't find any others. Try clearing the filter first: Me.FilterOn = False. If DiscPK is a number type, why do you convert parameter to string?

– June7
Mar 22 at 20:39






frmDisclosure is opened to a single record, there are no other records to navigate. The RecordsetClone has only one record, so of course code won't find any others. Try clearing the filter first: Me.FilterOn = False. If DiscPK is a number type, why do you convert parameter to string?

– June7
Mar 22 at 20:39














Thanks. Putting filteron= false in the before update event of the combox box results in runtime error 2115 - it is preventing Access from saving data in the field. When typing the whre condition, I was 'on autopilot' - done it that way so often that I don't think. I'll re- do is a number.

– Great Crosby
Mar 22 at 21:07





Thanks. Putting filteron= false in the before update event of the combox box results in runtime error 2115 - it is preventing Access from saving data in the field. When typing the whre condition, I was 'on autopilot' - done it that way so often that I don't think. I'll re- do is a number.

– Great Crosby
Mar 22 at 21:07













Reworking the parameter as number makes no difference.

– Great Crosby
Mar 22 at 21:12





Reworking the parameter as number makes no difference.

– Great Crosby
Mar 22 at 21:12













I hadn't realised that frmDisclosure is opened to a single record, there are no other records to navigate. Could be the clue that I need.

– Great Crosby
Mar 22 at 21:13





I hadn't realised that frmDisclosure is opened to a single record, there are no other records to navigate. Could be the clue that I need.

– Great Crosby
Mar 22 at 21:13













I expect "[DiscPK]=" & Me.DiscPK is restricting to one record.

– June7
Mar 22 at 21:18





I expect "[DiscPK]=" & Me.DiscPK is restricting to one record.

– June7
Mar 22 at 21:18












1 Answer
1






active

oldest

votes


















1














frmDisclosure is opened to a single record, there are no other records to navigate. The RecordsetClone has only one record, so of course code won't find any others. Turn off the filter first:



Private Sub ComboFind_AfterUpdate()
Me.FilterOn = False
With Me.RecordsetClone
.FindFirst "[DiscPK] = " & Nz(Me.ComboFind, 0)
If Not .NoMatch Then Me.Bookmark = .Bookmark
End With
End Sub


As you can see, declaring and setting a recordset object variable is not required. .EOF would probably work just as well, I have just always used NoMatch. This will set focus to record, not filter the form.



If you prefer to display single record, then set the Filter property.



Private Sub ComboFind_AfterUpdate()
Me.Filter = "DiscPK=" & Nz(Me.ComboFind, 0)
End Sub





share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55307086%2fmove-to-another-record-via-combobox-doesnt-work-in-some-circumstances%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    frmDisclosure is opened to a single record, there are no other records to navigate. The RecordsetClone has only one record, so of course code won't find any others. Turn off the filter first:



    Private Sub ComboFind_AfterUpdate()
    Me.FilterOn = False
    With Me.RecordsetClone
    .FindFirst "[DiscPK] = " & Nz(Me.ComboFind, 0)
    If Not .NoMatch Then Me.Bookmark = .Bookmark
    End With
    End Sub


    As you can see, declaring and setting a recordset object variable is not required. .EOF would probably work just as well, I have just always used NoMatch. This will set focus to record, not filter the form.



    If you prefer to display single record, then set the Filter property.



    Private Sub ComboFind_AfterUpdate()
    Me.Filter = "DiscPK=" & Nz(Me.ComboFind, 0)
    End Sub





    share|improve this answer





























      1














      frmDisclosure is opened to a single record, there are no other records to navigate. The RecordsetClone has only one record, so of course code won't find any others. Turn off the filter first:



      Private Sub ComboFind_AfterUpdate()
      Me.FilterOn = False
      With Me.RecordsetClone
      .FindFirst "[DiscPK] = " & Nz(Me.ComboFind, 0)
      If Not .NoMatch Then Me.Bookmark = .Bookmark
      End With
      End Sub


      As you can see, declaring and setting a recordset object variable is not required. .EOF would probably work just as well, I have just always used NoMatch. This will set focus to record, not filter the form.



      If you prefer to display single record, then set the Filter property.



      Private Sub ComboFind_AfterUpdate()
      Me.Filter = "DiscPK=" & Nz(Me.ComboFind, 0)
      End Sub





      share|improve this answer



























        1












        1








        1







        frmDisclosure is opened to a single record, there are no other records to navigate. The RecordsetClone has only one record, so of course code won't find any others. Turn off the filter first:



        Private Sub ComboFind_AfterUpdate()
        Me.FilterOn = False
        With Me.RecordsetClone
        .FindFirst "[DiscPK] = " & Nz(Me.ComboFind, 0)
        If Not .NoMatch Then Me.Bookmark = .Bookmark
        End With
        End Sub


        As you can see, declaring and setting a recordset object variable is not required. .EOF would probably work just as well, I have just always used NoMatch. This will set focus to record, not filter the form.



        If you prefer to display single record, then set the Filter property.



        Private Sub ComboFind_AfterUpdate()
        Me.Filter = "DiscPK=" & Nz(Me.ComboFind, 0)
        End Sub





        share|improve this answer















        frmDisclosure is opened to a single record, there are no other records to navigate. The RecordsetClone has only one record, so of course code won't find any others. Turn off the filter first:



        Private Sub ComboFind_AfterUpdate()
        Me.FilterOn = False
        With Me.RecordsetClone
        .FindFirst "[DiscPK] = " & Nz(Me.ComboFind, 0)
        If Not .NoMatch Then Me.Bookmark = .Bookmark
        End With
        End Sub


        As you can see, declaring and setting a recordset object variable is not required. .EOF would probably work just as well, I have just always used NoMatch. This will set focus to record, not filter the form.



        If you prefer to display single record, then set the Filter property.



        Private Sub ComboFind_AfterUpdate()
        Me.Filter = "DiscPK=" & Nz(Me.ComboFind, 0)
        End Sub






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 26 at 20:48

























        answered Mar 22 at 21:13









        June7June7

        5,72451227




        5,72451227





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55307086%2fmove-to-another-record-via-combobox-doesnt-work-in-some-circumstances%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript