Question : Access SQL Query Question

The code I am using below is not returning any results.  I know that it should return some results, at least one which is the ID that is passed to this Sub.  

I'm thinking there is an error on my part, and I just need a second set of eyes to look at it.

Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
Public Sub EnergizeEquipment(ID As String)

If MsgBox("Are you sure you want energize?", vbYesNo, "Energize") = vbYes Then
    
    Dim rst As DAO.Recordset
    
Set rst = CurrentDb.OpenRecordset("SELECT * FROM [Main-Master] WHERE ([IDTag]='" & ID & "') OR ([Parent Equipment] ='" & ID & "')")
    
CurrentDb.Execute "UPDATE [Main-Master] SET [ActualEnergizationDate]='" & Format(Date, "mm/dd/yyyy") & "' WHERE [IDTag]='" & rst(IDTag) & "'"
Else
    Exit Sub
End If
End Sub

Answer : Access SQL Query Question

change this

WHERE [IDTag]='" & rst(IDTag) & "'"

to

WHERE [IDTag]='" & rst("IDTag") & "'"
Random Solutions  
 
programming4us programming4us