access 2010 vba
in code prior to trying to do this..
I have a table linked via sql server "dbo_t_nsc_trackcode_trans
in this table i have a value for lookup. [opened_at] a date field
I'm trying to update a record in this table above.
In the sql string
g = date
Global g As Date
d = now()
pened = d
g = Forms!NSC_DataEntry.txtReO
If m = True Then
Dim db1 As DAO.Database
Dim rst1 As DAO.Recordset
Dim strSQL1 As String
Set db1 = CurrentDb()
strSQL1 = "SELECT [nsc_id_ref], [opened_at], [InProgress_or_closed_at] FROM [dbo_t_nsc_trackcode_trans_time_entry] where [opened_at] = '" & g & "' "
Set rst1 = db1.OpenRecordset(strSQL1, dbOpenDynaset)
' Dim q As DAO.Recordset
' Set q = CurrentDb.OpenRecordset("SELECT * FROM [dbo_t_nsc_trackcode_trans_time_entry] where [opened_at] = '" & g & "'", dbOpenDynaset, dbSeeChanges)
rs1![InProgress_or_Closed_at] = Now()
Forms!NSC_DataEntry.txtReOpened = ""