Updating field in access 2000.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Using access 2000 I cannot currently perform this one action can anyone
please help?
The problem is that I need some values in a table updated to “yesâ€. Now it
becomes complex. The system I am creating is a booking system and the booking
form contains the ID for the booking time. Now I need to produce an update
query, which updates a field in a table called allocated. Now this field
contains currently a no in it, but I need that once a booking has been made
for that time, the allocated field to be updated. So therefore it is based
upon a form to update a field in a table, I know there is a way of doing this
using a query but not sure how too.
Help would be appreciated
Thank you
 
The controls on a form trigger a lot of events you can use. So, the first step is to add an method to handles the interesting event (e.g., Click for a button, OnChange for text boxes). In the added method, the accordant UPDATE query has to be executed.

Private Sub ControlName_Click()
DoCmd.RunSQL "UPDATE allocated SET allocated.isallocated = 'YES' WHERE bookid = " & Me.[bookid] & ";"
End Sub

The example provides that the form contains a control that is called "bookid" (e.g., text box).

Kalle
 
Back
Top