J
James_Hudson
I'm new to SQL/ADP and have been having a hard time getting an UPDATE sproc
to work. Here's the scenario: I have a form (frm_EncounterCreation) that a
nurse fills out with patient info. There's a command button at the end that
produces a fax (using WinFax) for the referring doctor's office. When the
command button is pressed, I would like to UPDATE a field called
FirstRecordsReqDate with the current date, so the nurse doesn't have to
capture that value manually.
Here's the VBA behind the button for this action:
Dim dbs As Database, qdf As QueryDef, strSQL As String
Set dbs = CurrentDb
Set strSQL = "UPDATE dbo.tbl_MainData Set FirstRecordsReqDate = GETDATE()
WHERE @EntryID =" & Forms![frm_EncounterCreation]![EntryID]
Set qdf = dbs.CreateQueryDef("update", strSQL)
When I click the button, however, I get a message stating "Compile Error:
Object Required", and highlighting the I[EntryID] of my WHERE statement. Can
someone please point me in the right direction? Thanks very much!
to work. Here's the scenario: I have a form (frm_EncounterCreation) that a
nurse fills out with patient info. There's a command button at the end that
produces a fax (using WinFax) for the referring doctor's office. When the
command button is pressed, I would like to UPDATE a field called
FirstRecordsReqDate with the current date, so the nurse doesn't have to
capture that value manually.
Here's the VBA behind the button for this action:
Dim dbs As Database, qdf As QueryDef, strSQL As String
Set dbs = CurrentDb
Set strSQL = "UPDATE dbo.tbl_MainData Set FirstRecordsReqDate = GETDATE()
WHERE @EntryID =" & Forms![frm_EncounterCreation]![EntryID]
Set qdf = dbs.CreateQueryDef("update", strSQL)
When I click the button, however, I get a message stating "Compile Error:
Object Required", and highlighting the I[EntryID] of my WHERE statement. Can
someone please point me in the right direction? Thanks very much!