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
Solved

Change field value programatically

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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…

808 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