Page 3 of 3 FirstFirst 123
Results 31 to 35 of 35
  1. #31
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,421

    OK, but doing a move first or last is not a requery. Or am I not following?

    Me.RecordsetClone.MoveLast
    lngCount = Me.RecordsetClone.RecordCount <<now lngCount is the recordsetclone record count
    DoCmd.OpenForm "frmItemDescriptor", , , , , acDialog << a different form opens. If it alters the recordsetcount of the first form, it won't alter the clone of the first form
    Me.RecordsetClone.MoveLast <<so if the recordsetclone.recordcount is 20, so is lngCount

    Did you remember to step through your code and examine your variables and properties that they might relate to?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  2. #32
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,549
    I would have thought the requery would be needed to see if a new record had been added?
    I would probably requery regardless but stay on current record, as the form was opened generally to add a new record?

    However the DCount() should show any difference without needing to requery?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #33
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Bill is having difficulty posting and asked me to post the following thoughts:

    Would you point out to him (Micron) that the two forms involved use the same table as Recordsource, thus the subordinate form might in fact add a new record as part of its multi-purpose functionality.

    Somehow I've failed to create the understanding that the main form uses a common form to either display the current details of an already registered item versus adding a new item. In the latter case, the user might or might not actually add a new item but rather investigate some of the images available pertaining to the intended item. Hence, the "main" form needs to know if a Requery is needed when a new record is added. Item records can hold the names of up to six images of the item. See second screenshot.
    Attached Thumbnails Attached Thumbnails Bill1.jpg   Bill2.jpg  
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #34
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,421
    Thanks for that assistance. This thread is marked as solved, so am I just confusing things by chiming in? Or is there still a problem?
    I made a point about using a wildcard in post 9 that may or may not be pertinent but I don't see where it was addressed. Also, in post 29 I'm saying that the recordsetclone is a fixed object in memory. If you add a record to the form recordset the recordsetclone won't be affected whether you move last on it or not. Or am I wrong about that?

    I agree with WGM. If there's code for the event where a record is added, then requery the form from there. You may have to bookmark the recordset clone before requerying, so that you can stay on the current record.

    Maybe try pm'ing to see if that works if you can't post. If I'm not helping let me know and I can bow out, otherwise I might have to read all from the beginning.
    I don't suppose a db copy is available?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #35
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,549
    My tip for requerying and NOT moving from current record is to requery the recordset NOT the form
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

Page 3 of 3 FirstFirst 123
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 29
    Last Post: 03-30-2025, 01:52 AM
  2. Replies: 13
    Last Post: 11-04-2019, 04:04 PM
  3. Replies: 4
    Last Post: 06-10-2018, 03:53 PM
  4. Replies: 1
    Last Post: 06-15-2017, 05:49 PM
  5. Replies: 2
    Last Post: 09-20-2014, 11:28 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