Question Please help!!!!! Urgent!!!

Dobbie

New member
Local time
Today, 20:39
Joined
Feb 2, 2012
Messages
6
i want to create an update query based on the following conditions.

when the [Check Out] button in the form [Check Out] is clicked the update query should update the field [Status] in the query [Equipments Query] to "Unavailable"!!!!

when the [Check In] button in the form [Check In] is clicked the update query should update the field [Status] in the query [Equipments Query] to "Available"!!!!

Sp if anyone has got even a small clue how to do this please share it with me!!!!!!!!!
 
You could do this simply by using the Docmd.RunSQL command, each actioned depending on whether Check-in or Check-out, but behind the OnClick event of each button you could write:
for Check-in
Docmd.RunSQL("UPDATE tblEquipments SET tblEquipments.status = 'Available' " _
& "WHERE(((tblEquipments.equipmentID) = Forms!frmCheckIn.equipmentID))")

for Check-out
Docmd.RunSQL("UPDATE tblEquipments SET tblEquipments.status = 'Unavailable' " _
& "WHERE(((tblEquipments.equipmentID) = Forms!frmCheckOut.equipmentID))")

You'd have to replace the objects with their correct table/field names
If you want to do running normal update queries then use the wizard on the criteria line for the equipmentID ie Forms!frmCheckIn.equipmentID and update the status field to Available or Unavailable

David
 

Users who are viewing this thread

Back
Top Bottom