change the yes/no value in a table

  • Thread starter Thread starter JattilaB
  • Start date Start date
J

JattilaB

I am trying to set the yes/no value on a record in a table ...
if is true the set it to false


how can I achieve this using VB in access

currently this is my code

ProRecords = DCount("[ProID]", "Procedure")
Set db = CurrentDb()

Set rst = db.OpenRecordset("Select * from [Procedure];")
ProVar = rst.GetRows(ProRecords)

Do Until r = ProRecords

If ProVar(7, r) = True Then



any help would be appreciated...
 
Jattila,

The easiest way to do this is by using an Update Query:
- Make a query in design view based on your Procedure table
- add the ProVar field to the query design grid
- select Update from the Query menu
- in the Update To row of the grod, put 0
- run the query

The SQL of the query will look like...
UPDATE Procedure SET ProVar = 0;

If you want to use a macro to make it happen, use the OpenQuery macro
action. If you want to use a VBA procedure to make it happen, you can
simply do this...
CurrentDb.Execute "UPDATE Procedure SET ProVar = 0"
 
Back
Top