Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2013
    Posts
    70

    Unanswered: Access 2013 Choose which of two forms to requery on close of third form

    Good morning, very snowy US east coast time. I have two forms that both use the same third form to add records. When I close the third form I want to requery whichever of the two forms is currently open. Or have Access discover which is open and requery that one. Is there a way to accomplish this? Thanks, Scott

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    you can query the forms collection to find what forms are open
    or
    you could open the data entry form from one of these forms and send the name of the calling form to the data entry one
    or you could just forget being clever and fancy about it and tell the form to requery when the activate event is called
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Mar 2013
    Posts
    70
    Quote Originally Posted by healdem View Post
    . . . tell the form to requery when the activate event is called
    Thanks so much. I was not trying to be clever so much as assuming it would take a clever trick. The activate event works as you expected. But I have small problem associated with it. The form opens from a query with a year criteria which causes an eternal loop when I try to answer the criteria. Is there any way you know of around this? Best, Scott

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    sorry I wasn't inferring you were trying to be clever . IO was inferrign thast ratherthan do some clever tricks with VBA (finding what forms are open, or posting a value inbetween forms, or reqerying another from) just use the forms on activate event.

    ok so you will need to do a rethink on this. personally I'm not a fan of parameters within a query that require user input. that input cannot be validated, it bneeds to be re inoput every time the query is run, and if (effectively) the same parameter is required in multiple queries (eg in a reporting suite) it becomes a PITA. not least of which is when the reports or forms come out with different values, and the user will swaer blind its not their fault

    SO how to get round this
    well a possible approach is to set the year value within a/the form, and use that value in the query/queries.
    when your form(s) start up use a sensible known defautl value (eg the current year) and pull values based on that value. (set it as a filter. leave the base query alone but in effect apply the where clause as a filter,

    in your form allow users a mechanism to select a different parameter value (or no value)

    Im sure theres other appraoches but thats the best I can think of right now....
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •