Solved

Change field value programatically

Posted on 2001-07-06
5
206 Views
Last Modified: 2006-11-17
I am in Access 2000 and have developed an application with a form where the user looks up a record.

I want a button on the form to change the value of one of the fields on the form (the field has a table datasource) that puts that changed value into the table.

How can I do this?
0
Comment
Question by:awilson1199
[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
5 Comments
 
LVL 2

Expert Comment

by:Gudare
ID: 6260797
From what I understand of your question, if you go to the on_click event of the button and select the builder-code builder, the following pseudocode should work:

me.textboxonform = me.othertextbox

Please give more details to your exact request for a clearer answer. :)

-Craig
0
 
LVL 1

Expert Comment

by:frankylew
ID: 6261462
supporting Gudare ...
0
 

Author Comment

by:awilson1199
ID: 6261732
Haven't tried it yet, it is at work. I want the user to click a button and that will insert a "V" in a bound text box on the form which changes the data in the field from a "C" to a "V"
0
 

Accepted Solution

by:
PhilipE earned 50 total points
ID: 6265805
Greetings AWilson1199,

As I do not know the name of the field you wish to change, we shall, for arguments sake, call it Field1.  Assuming this, the following code will perform the function you require.  First, however, you must create a button on the form.  Once you have created this button, right click on it in design mode, this will bring up an option box.  select PROPERTIES from this selection.  Give the button a legible name e.g. cmdFieldUpdate
In properties, select the EVENT tab and click on the CODE BUILDER button for the ON CLICK event.
Next select the option CODE BUILDER, this will fire up your VBA screen.  In this screen Include the following in the following:

Private Sub cmdFieldUpdate_Click()

Field1 = "V"

End Sub

It truly is as simple as that.

Hope I've helped.

YES! The first question I've been able to answer.  Roll on Expert of the week title (Yeh right!)
0
 

Author Comment

by:awilson1199
ID: 6266664
You are right, that was too easy. I never considered something that simple, you should have seen some of the things I tried.

Thanks!
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

615 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