-1

I have an access form that contains an Id field.Once a user enters the Id , i want to run a query on the after update event to get the patients history field and display it as a msg box.

The query is as follows :

"Select Patients.[Patient History] From Patients Where Patients.ID = " & Me.PatientID

How can i do this?

thank you

1

1 Answer 1

1

You can use DLookup in a one-liner:

MsgBox Nz(DLookup("[Patient History]", "Patients", "ID = " & Me!PatientID.Value & "")), vbInformation + vbOkOnly, "Patient History"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.