Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,142
    Quote Originally Posted by Welshgasman View Post
    It is not OpenArgs Jack?
    That is the last parameter in the open form command.



    What has been shown in the open form commands is setting the filter. Intellisense shows you that as you enter the command.

    My thoughts were to pass in the value via OpenArgs, and in the target form, if OpenArgs has a value then findfirst using that value.
    As shown by davegri and kd2017

    I figured it would just be a little cleaner, or more portable, to let your calling sub navigate the form rather than have the form itself make that game time decision


    Thinking on it a little more, I'd probably add some code if record not found to warn the user and/or close the form so the user doesn't mindlessly accidentally modify other existing records.

  2. #17
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,861
    To each their own.
    I would think along the lines of if openargs present, go to record?
    Code then in one place as opposed to multiple places, but all depends in requirement of course.
    I do not like hardcoding form names as criteria in queries, but rather would use tempvars, but again that is just me.
    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. #18
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,142
    Quote Originally Posted by Welshgasman View Post
    To each their own.
    I would think along the lines of if openargs present, go to record?
    Code then in one place as opposed to multiple places, but all depends in requirement of course.
    I do not like hardcoding form names as criteria in queries, but rather would use tempvars, but again that is just me.
    What I'm saying is rather than checking openargs in the load event of every form you could create one general subroutine that opens and navigates a given form, form name and search string as params. Actually less code Id think?

  4. #19
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,861
    Quote Originally Posted by kd2017 View Post
    What I'm saying is rather than checking openargs in the load event of every form you could create one general subroutine that opens and navigates a given form, form name and search string as params. Actually less code Id think?
    Could well be. As I mentioned before, to each their own.
    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

  5. #20
    d9pierce1 is offline Expert
    Windows 10 Access 2019
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    754
    Thank you all for the info and assistance.
    For those that were curious on why not just open form,
    If I have 5000 records and I want to go directly to a specific record then I want the form to open to that record unfiltered as
    I have other subforms on that page that effects them when form is filtered. Not to mention I dont want to add an Unfilter button on form to be
    able to get to a different record. The actual list box in in my main menu and rather then to go back or unfilter, i just want it unfiltered without having to check a button!
    Thank again, I am sure I will get this to work!

    Sorry for delayed responce as I had to do some traveling with my work past week and didnt have access!
    Thanks
    Dave

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 01-30-2022, 01:34 AM
  2. DblClk to open form
    By d9pierce1 in forum Programming
    Replies: 3
    Last Post: 10-23-2021, 10:28 AM
  3. Open Form and goto record with Listbox selection
    By GaryShelton in forum Programming
    Replies: 7
    Last Post: 01-04-2019, 05:54 PM
  4. Replies: 2
    Last Post: 02-22-2017, 05:45 AM
  5. Replies: 1
    Last Post: 06-09-2012, 05:44 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