VBA code to display previous sale date from the same customer

Paul, your attached database has only a linked table in it
Well that is handy. I exported it to a new table, not thinking it would keep it as linked. :(
I have made it local now.

Thank you Pat.
 

Attachments

I have a database containing patients with blood test results. The table is called tblDatabase and the relevant fields for this discussion are Firstname, Surname, DOB, and SampleDate. Data entry is done through a form called frmDatabase. Some patients have their tests done repeatedly. While entering patient details on frmDatabase, I fill in the Surname field, then the Firstname field, and then the date of birth (DOB). I'm wondering if it's possible to write a VBA code (possibly using the After Update event) so that a textbox created in frmDatabase displays the sample date of the last test done for the patient in the database. I've been told that DMax might be involved in achieving this. So I want a previous match for surname, firstname and date of birth.
@Sreemike :
A couple of other questions which will impact how you design this project:
  1. May a patient use different hospitals for testing or are they assigned to just one hospital?
  2. May each hospital have multiple consultants which in turn serve multiple patients or is there just one consultant for each hospital?
 
Man in the paper today.
Being chased for a debt he did not owe.

Turns out it was for another, with exactly same name and dob. :)
 
Man in the paper today.
Being chased for a debt he did not owe.

Turns out it was for another, with exactly same name and dob. :)
In this case, it's possible for two people with the same name and DOB to get tested at the same hospital on the same day. Makes a good case for proper relational design, doesn't it?
 
Yes, you would not one to have cancer and the other kidney failure?
Could turn out disastrous?

Yet that is all I get asked when going for bloods etc?
 
@Sreemike :
Is it important to know the time in days when the last test was done for each patient?
 

Users who are viewing this thread

Back
Top Bottom