
Signature
Dave Hargis, Microsoft Access MVP
Thanks Dave.
I have just really started to enter code into my database. What event
should I enter this code into.....I am thinking after update? What does
lngKeyVal mean and would I put PtID in the brackets [KeyField]. Not sure if
this would help but here is the sql for the query that my main form is based
on.
SELECT tblPatients.PtLName, tblPatients.PtFName, tblPatients.PtID,
tblPatients.MRNum, tblPatients.AdmitNum, tblPatients.AdmitDtTm,
tblPatients.DCDtTm, tblPatients.PtMI, tblPatients.PtDOB,
tblPatients.PtActive, tblPatients.Isolation, tblPatients.PtMemo,
tblPatients.Diagnosis, tblPtLocation.PtLocRmNum, tblPtLocation.PtLocEnDtTm,
tblPtLocation.BedID_fk
FROM tblPatients LEFT JOIN tblPtLocation ON tblPatients.PtID =
tblPtLocation.PtID_fk
WHERE (((tblPatients.PtActive)=Yes) AND ((tblPtLocation.PtLocEnDtTm) Is
Null))
ORDER BY tblPatients.PtLName, tblPatients.PtFName;
Linda
> First, how are you deleting the record? It may not actually be deleting
> the
[quoted text clipped - 41 lines]
>> Thanks,
>> Linda
Klatuu - 31 Oct 2007 15:26 GMT
The code would go in the Form's After Update event.
As to lngKeyVal, that is just an example where I am assuming an autonumber
primary key. What you would use would be the actual data type of whatever
your primary key is. If it is PtID, then you would use it's data type to
save the key value of the record. Brackets in this case are not necessary,
it is my personal habit to put brackets on all field names. Don't confuse
field name with a control name. Fields belong to tables and queries.
Controls are on forms and reports.

Signature
Dave Hargis, Microsoft Access MVP
> Thanks Dave.
>
[quoted text clipped - 63 lines]
> >> Thanks,
> >> Linda