Solved

Allowing users to set update value?

Posted on 2014-01-05
4
272 Views
Last Modified: 2014-01-20
would there every be a way to allow user to select an option from a drop-down menu and then have that update/populate through all records of the database in that same field?
0
Comment
Question by:daisypetals313
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 22

Expert Comment

by:Kelvin Sparks
ID: 39758601
Your question is somewhat brief, but from what I understand of your question the answer is yes. You'd capture the selection into a variable and use that in VBA to do the necessary updates.


Kelvin
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 39758917
So you want to update EVERY value in a column, based on the value chosen by the user in a combo?

To do that:

Currentdb.Execute "UPDATE YourTable SET YourField=" & Me.YourCombo.Column(0)

If YourField is a Text field:

Currentdb.Execute "UPDATE YourTable SET YourField='" & Me.YourCombo.Column(0) & "'"

If YourField is a Date:

Currentdb.Execute "UPDATE YourTable SET YourField=#" & Me.YourCombo.Column(0) & "#"

Understand, however, that this updates EVERY record in the table. If you need to update only certain records you'd have to include a WHERE clause to the above statements.

Obviously, you'd have to change the Table, Field and Control names to match those in your project. This also assumes that the FIRST column in the Combo is the one to be used for the update value.
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 39759211
the question that would come to my mind (as feeble as it is) is:

If the values in a field "for all records in that table" are the same, then why do you even need the field?  

It sounds like that needs to be an application  wide value which you could load/store in a db_Properties table, or actually store as a property in the database.  If you do it this way, you could load that value into a TempVar or into a global variable when you start your application, then write it back if it changes.
0
 

Author Closing Comment

by:daisypetals313
ID: 39795160
thanks!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question