G
Guest
I need to select a record with a SQL, which will execute when i click a
button. the field SSN is in the main form, the field DateOfVisit is in a
subform (which is on a tab within the main form). i have tried the follwing
but have been unsuccessful.
If DCount("[SSN]", "New_Visit", "[SSN] ='" & Me.SSN & "'") > 0 Then
Dim strnewvisitSQL
strnewvisitSQL = "UPDATE [New_Visit] SET [TimeStamp] = Now()" & " WHERE
DateOfVisit =#" & Me.New_Patient_Entry_Subform.DateOfVisit.value & "# AND SSN
= '" & Me.SSN.value & "';"
CurrentDb.Execute strallerSQL, dbFailOnError
End If
it works fine if i take out the part with the dateofvisit, but i need to
only chnage the timestamp for the specified dateofvisit. anyhelp is
appreciated.
thank you
russ
button. the field SSN is in the main form, the field DateOfVisit is in a
subform (which is on a tab within the main form). i have tried the follwing
but have been unsuccessful.
If DCount("[SSN]", "New_Visit", "[SSN] ='" & Me.SSN & "'") > 0 Then
Dim strnewvisitSQL
strnewvisitSQL = "UPDATE [New_Visit] SET [TimeStamp] = Now()" & " WHERE
DateOfVisit =#" & Me.New_Patient_Entry_Subform.DateOfVisit.value & "# AND SSN
= '" & Me.SSN.value & "';"
CurrentDb.Execute strallerSQL, dbFailOnError
End If
it works fine if i take out the part with the dateofvisit, but i need to
only chnage the timestamp for the specified dateofvisit. anyhelp is
appreciated.
thank you
russ