Using a Form Button to change the data in a field

  • Thread starter Thread starter Chip
  • Start date Start date
C

Chip

Howdy from Oklahoma!!

I have a form that shows data from a Contruction Project. When the projects
are input the status is "Planning" as designated by the field "ProjStatus"
set to 'P', but i want a button that the user presses that changes this
field (ProjStatus) to 'A' meaning that the Project is now "Accepted". I
have not found any Wizards or VB code to make this simple change. I must be
missing something. Can someone assist?
I am new to VB and MS ACCESS for that matter so be gentle with answers.

THANKS IN ADVANCE!!!

Chip
 
Place a button on the form. (for example... name it [cmdA])
In form design mode, select the button [cmdA], and place
your cursor in the OnClick event field of the button Property Box.
Select "Event Procedure" from the dropdown that appears to the right of
that field.
Now click the (...) button that also appeared to the right of the OnClick
field.
This will take you to where you can insert vb code to accomplish what you
want.
Make OnClick event of your button look like this...

Private Sub cmdA_Click()
Me.ProjStatus = "A"
End Sub

hth
Al Camp
 
Back
Top