change value in a seperate table

R

Russ

I am using Pendragon Forms to put my access database on the palm, this
program uses a timestamp to limit hte record on the palm to the last 28 days.
I need a code to chagne the timestamp to the current date and time in
several tables which have the patient i want on the palm. the button to run
the command is in a form called "Patient Chart" and i would like it to query
several tables and if the patient is present in the table to change the
timestamp.

i tried : If DCount("[SSN]", "Demographics", "[SSN] ='" & Me.SSN & "'") > 0
Then
[demographics].[SSN] = Date
End If

but this did not work. any help would be appreciated.

russ
 
G

George Nicholson

I would think you need something more like:
strSQL = "UPDATE Demographics SET [SSN] = Date() WHERE [SSN] ='" &
Me.SSN & "'"

and then either
DoCmd.RunSQL strSQL
or
CurrentDB.Execute strSQL, dbFailOnError

HTH,
 
J

John Nurick

Hi Russ,

It's usually simpler to build and execute SQL update queries as
required, e.g. this (XXX is the name of the timestamp field)

Dim strSQL

strSQL = "UPDATE Demographics SET XXX = Now()" _
& " WHERE SSN = '" & Me.SSN.Value & "';"
CurrentDB.Execute strSQL


I am using Pendragon Forms to put my access database on the palm, this
program uses a timestamp to limit hte record on the palm to the last 28 days.
I need a code to chagne the timestamp to the current date and time in
several tables which have the patient i want on the palm. the button to run
the command is in a form called "Patient Chart" and i would like it to query
several tables and if the patient is present in the table to change the
timestamp.

i tried : If DCount("[SSN]", "Demographics", "[SSN] ='" & Me.SSN & "'") > 0
Then
[demographics].[SSN] = Date
End If

but this did not work. any help would be appreciated.

russ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top