Change field value via button and VB

Sola

Registered User.
Local time
Today, 08:58
Joined
Jun 1, 2007
Messages
14
Hi, I am looking for some help with VB code.

I have a form that lists prescriptions. One of the fields, fldTransactionType, has two options: "Prescribed Rx" and "Voided Rx." In this form that I am working on, the user sees a list of all prescriptions, and I have a button in each row that says "Void This Rx."

What I want is for the user to be able to press the button and the following happen: fldTransactionType is reset to "Voided Rx," the record is saved and the form is refreshed (so the record is updated to say "Voided Rx" and the user can visually see that the change has been made).

I know how to save the record and refresh the form, but I am at a loss as to how to change the value to "Voided Rx." My VB experience so far is with using DoCmd, OpenForm, etc. I have not really tried tinkering with changing values before. I tried btnVoidRx.RowSource="Voided Rx" but that did not work. Can anyone help me figure out VB command I should be using?
 
You will need to use the Onclick Event of your button to change the value of fldTransactionType. Is this field Bound or unBound. If it is bound then the table should be updated automatically
 
Hi, Rabbie, and thanks for the response. I have the form based off of a query, actually, but I think I get what you are saying. I will try basing it off the table and get back to you.
 

Users who are viewing this thread

Back
Top Bottom