Solved

Change field value programatically

Posted on 2001-07-06
5
203 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

734 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