Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Query or VB for selected record

Status
Not open for further replies.

McFestoe

Technical User
Dec 16, 2003
145
GB
I have the following in a update query

Code:
UPDATE [Alarm List] SET [Alarm List].[Letter Sent] = 1, [Alarm List].[Letter Date] = Date(), [Alarm List].[Note] = "Service Letter Printed"
WHERE ((([Alarm List].[Letter Date]) Is Null));

Is it possible to change this to VB code so it can be called by a button, the other problem is that it updates all records and i am trying to get it to update the record on the screen only,

 
and i am trying to get it to update the record on the screen only
If the controls are bound to the [Alarm List] table, then simply modify their value.
Otherwise take a look at the DoCmd.RunSQL or CurrentDB.Execute methods and make your WHERE clause more restrictive (the usual way is to test the PrimaryKey value).

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top