UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Letter User Select Default Value For Combo Box, Access 2016    
 
   
bartinpc
post May 15 2019, 08:05 AM
Post#1



Posts: 60
Joined: 18-July 07
From: Panama City, FL


I have a database that lets users select a Customer and Location for various reports. Those work fine.

I'd like for the user of the database themselves to be able to select a default value for the Customer and Location combo boxes. I know that you can go in properties and select the value, but some of my users have no business changing things in properties.

So what I've done is add a field to the tblCustomers and put a Yes/No checkbox for the "Preferred" field.

So when they are entering the Customers in their database, they can select the one they will use the majority of the time to auto-populate in the combo box for the reports.

I'm not sure how to have the Form combo box look to the Yes/No field so it'll know which one is the default. My Google searches all keep talking about how to manually set it, but it's not a good idea of have users in the properties.

Any help would be greatly appreciated!!
Go to the top of the page
 
Minty
post May 15 2019, 08:24 AM
Post#2



Posts: 309
Joined: 5-July 16
From: UK - Wiltshire


Assuming you have multiple users, are you looking to set a default per user or for all users ?

As it stands you would only have the option for everyone set to the same.
Go to the top of the page
 
bartinpc
post May 15 2019, 08:31 AM
Post#3



Posts: 60
Joined: 18-July 07
From: Panama City, FL


They each have a copy of this database on their laptop for their own site (they are not networked).

Thus they each would be able to select their own defaults, but I want to make it easy for them (and prevent them from poking around in the preferences).
Go to the top of the page
 
DanielPineault
post May 15 2019, 08:50 AM
Post#4


UtterAccess VIP
Posts: 6,671
Joined: 30-June 11



You could create a UserSetting table with a form in which the could set such properties and then use the Form load/open events to define the various properties accordingly.

--------------------
Daniel Pineault (2010-2018 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
projecttoday
post May 15 2019, 09:03 AM
Post#5


UtterAccess VIP
Posts: 10,758
Joined: 10-February 04
From: South Charleston, WV


If you want the users to select a default create a table for the user's preference. Create a screen for updating this table. Do away with the field in the customers table. When the form with the customer selection opens, read the preference and set the default value from that.

Edit: Daniel beat me to it.

--------------------
Robert Crouser
Go to the top of the page
 
kfield7
post May 15 2019, 12:16 PM
Post#6



Posts: 961
Joined: 12-November 03
From: Iowa Lot


I would as suggested have a table for default preferences.
I would put a "Make this the default" button next to the combo box - the code would populate the current value into the defaults table.
Go to the top of the page
 
bartinpc
post May 16 2019, 09:11 AM
Post#7



Posts: 60
Joined: 18-July 07
From: Panama City, FL


Okay, I know I need to put some VBA in the OnLoad property for the form, but I'm getting in unchartered waters for myself. Other than basic macros or using the builder, I'm pretty much at a loss when it comes to this aspect of Access.

Any help here would be greatly appreciated. Also, any "learn by doing" VBA courses (pay or free) that are recommended would be appreciated too.
Go to the top of the page
 
projecttoday
post May 16 2019, 04:35 PM
Post#8


UtterAccess VIP
Posts: 10,758
Joined: 10-February 04
From: South Charleston, WV


Okay, but let's ask a few more questions. Is the database split? How many users are there? How do you distinguish one user from another? Are there any other fields you want default values by user for? Are there any other settings that you think would be useful to vary by user (or any other way)?

Do you anticipate or think that there is any chance that more such pre-determined-settings functionality will be wanted in the future?

--------------------
Robert Crouser
Go to the top of the page
 
bartinpc
post May 20 2019, 09:25 AM
Post#9



Posts: 60
Joined: 18-July 07
From: Panama City, FL


The database is not split and each copy of the database is independent. Internet availability is not guaranteed for this job, thus why each user will have it's own "island". There is no need to connect them at a later time as well. There will be 5-10 copies of this database.

These are all the default values I have seen. After I see the code/process, I can likely put this together in the future if needed.

This database and the forms it creates are pretty static/matured, so the need for future changes is very low.

Thanks...
Go to the top of the page
 
projecttoday
post May 20 2019, 09:45 AM
Post#10


UtterAccess VIP
Posts: 10,758
Joined: 10-February 04
From: South Charleston, WV


You could do a table table for default or a table for default customers (really simple). You also could do a table for settings, but settings can be more complicated. But, as you say, you don't anticipate many settings. So to keep it simple just do a default customer table. Just one field, the default customer's ID or number. Then in the On Open event of the form use Dlookup to read this and set the default value. You can change it later on if necessary, adding a user field, changing if to default values instead of default customer, etc. But a simple table with one record with the customer in it should work for now. You can create a screen to update this table. Let the user pick what he/she wants as a default customer.

--------------------
Robert Crouser
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    24th June 2019 - 08:41 PM