×
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!
  • Students Click Here

*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.

Students Click Here

Recall last settings function
2

Recall last settings function

Recall last settings function

(OP)
Good morning!

I have a form (ReportParams) that supplies (criteria) values to various reports. End user would like to be able to recall the last values he used. I have no idea how to make this happen for him. Do any of you?

I thank you in advance for any insight, and hope ya'll are having a wonderful day!

RE: Recall last settings function

Do you mean “last values he used” when he was using your app last week? Or, user creates a report and you clear all criteria values when the report is done, so user have to re-enter them again?

If the former, keep the criteria in your data base.

If the latter, don’t clear the values. Keep the criteria values on the form, but give them a way to clear it if the choose, like with a command button ‘Clear Criteria’


---- Andy

There is a great need for a sarcasm font.

RE: Recall last settings function

I agree with Andy regarding storing the values in a table. To be more flexible in the future I would create a normalized table with fields like:

tblReportParams
rppRpPID    primary key autonumber
rppUser     You might use the same table for multiple users or even collections of values
rppForm     Which form
rppControl  Control Name on the form
rppValue    store the actual value
 

You could use a little code in the on open of the form to find the particular user and run through the records to set the values. You would also either automatically save new values to the table or ask the user if they want to save. They might save multiple sets by adding a rppSetName field. Add a combo box to the form to allow selecting a particular set of values.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016

RE: Recall last settings function

(OP)
Thanks guys! That's kind of what I was thinking as well! Stay well my friends!

RE: Recall last settings function

(OP)
One more question, some of my fields are multi value fields, how should I store them and recall them?

Thanks again!

RE: Recall last settings function

Could you give an example of your multi value fields?

You may be able to save them to the table, and retrieve them with Split() function.


---- Andy

There is a great need for a sarcasm font.

RE: Recall last settings function

(OP)
Sure! I have a list box for Salespeople, the multi select is set to Extended. The filter uses OR between names. For my own sanity I have a text box underneath the list that shows me the actual criteria, just using it until I have everything working properly. I don't use said text box in the filter, I use the list box.

Nearly all the selections are list boxes with multi select set to extended. There's a couple of date fields and a dollar amount field as well.

Thank you!

RE: Recall last settings function

So, if your list box displays items:
1
2
4
7
9


And user selects: 1, 4, and 9, you can save 1 4 9 in one field, and then when you want to get it back, you can always use Split(DBField, “ “) and you get the array with 3 elements: 1, 4, and 9

I am sure there is a better way to do it, too... smile


---- Andy

There is a great need for a sarcasm font.

RE: Recall last settings function

(OP)
Thanks Andy! I don't think I've used the split function before. I'll give it a shot!

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! Already a Member? Login

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