Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2004
    Posts
    34

    Unanswered: Requery/Refresh Form

    I have a form and subform that when opened prompts user for id#. The id# number is the criteria for the form, the user then enters new records into the sub form. The user then must close form and re-enter in order to get promted for criteria again.

    I have tried to put a button on the form to refresh, but that doesn't bring up the prompt. Is ther code or something that I can use to make the form refresh and prompt user for id# without having to close and re-open? Where should the code be put?
    Last edited by Falcon049; 09-24-04 at 09:14.

  2. #2
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    make your refresh code an independent procedure, and call it directly from your button event & form's open event.
    ghozy.

  3. #3
    Join Date
    Aug 2004
    Posts
    34
    I am very new to databases and don't understand exactly what you mean...can you give me a little more detail..thanks

  4. #4
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    are you using macros or VBA to accomplish this?
    ghozy.

  5. #5
    Join Date
    Aug 2004
    Posts
    34
    I used a wizard to create the button, I'm pretty sure that is VBA

  6. #6
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    how did you manage asking id# to user when the form opens? I'm just trying to understand what you have done, so I can advice something. either if you can attach your database to thread so I can look at.
    ghozy.

  7. #7
    Join Date
    Aug 2004
    Posts
    34
    The form's row source is a query of tbl.submissions, with criteria for id# being [Enter Id#], the subform is linked to the form by this number. By entering the id# the main form shows info from tbl.submissions, and the sub-form shows all data from tbl.rfq. Hope this helps. The database has user-level security so I don't think you would be able to open it Thanks for your time, I really have tried many options and have not found a solution yet.

  8. #8
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    ok I will give you a step by step workaround for that problem, but you really need to work on learning some VBA if you want to continue developing on Access.
    1. create a new button, don't use wizard.
    2. right click on the button and choose Build Event...
    3. you will go to VBA code editor at this point
    4. add the line below between private sub and end sub lines
    me.refresh

    5. save and try it.
    ghozy.

Posting Permissions

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