INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Forms and query parameters autofill from previous form

Forms and query parameters autofill from previous form

(OP)
I am a fairly new access user and I have been tasked with debugging and restructuring an existing database for my small company. There is one main issue that I have been unable to resolve and I was hoping someone could suggest a strategy to handle it.

The purpose of the database is to store information for each of our clients, including the company info, the products they subscribe to, and their billing information. Then the database is used to determine who to bill each month and to make the invoices.

The overall issue is that the user has to re-enter the same information every time they open the next form or run a query from a form. For example when we add a new client to the database, the user will go through multiple forms for the same company and each time they open a new form they have to re-select the company. A variant of this issue is that when they run a query through a command button on a form they are asked to re-enter parameters that are already filled out in the form.

I've been looking at forums and have found a few suggestions, but nothing seems to work consistently. I've been trying things like setting the where conditions in openform macros or setting the last entered record to default, but I think I need a more system-wide solution if possible.

I'm a bit stuck on where to go from here, so any suggestions are welcome! I can provide more information about the database as well.

RE: Forms and query parameters autofill from previous form

You have your Client information in Clients table (I assume). So if the User selects a Client (avoid entering information you already store), you may just store ClientID in a Global variable (in standard Module).
Then, in any Form / query that you need to re-call this information anywhere in your app, just grab the info from your Clients table based on stored ClientID

Have fun.

---- Andy

There is a great need for a sarcasm font.

RE: Forms and query parameters autofill from previous form

Without knowing a lot more of how your table structure and how the forms are designed I am only guessing. It sounds to me that you create a client and then you have multiple forms to add child records to that client or information related to the Client. If you can tell us about those forms and what they do it would help. Often this is done with a main form and then subforms on possibly a tab control. On the first tab would be stuff like company information, second tab products, etc. With this design it is easy to stay on the current client by linking the main form to the subforms. But instead your design uses separate forms. On those forms you now have to tell it which client you are working on. Depending on how you open the form you could save the "current Client ID" in either a global variable or in a small table. Then when you open the form you could set the client ID to the current client id.

RE: Forms and query parameters autofill from previous form

(OP)
Thanks MajP and Andrzejek,

Setting the client ID as a global variable worked for the forms!

To solve the issue with the queries I found a suggestion to set the criteria as [Forms]![FormName].[Field] with the field being the combobox on the form where the parameter was already filled out. Not sure if that was an obvious fix but it worked for me.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close