Select only certain fields from a record?

P

Pat Dools

Hello,

I need to adjust the following code to be able to pick only 3 fields
(edrecno, ptin, patient) from a record that has a lot more than 3 fields.
This code selects a distinct row of records, but each row only has 3 fields
(columns):

Private Sub SelectPatient_Change()
Me.RecordSource = "SELECT DISTINCTROW LU_Patient.* " & _
"FROM TableEdit" & _
"WHERE
(((TableEdit.patient)=[forms]![fEnterPatientInfo]![selectpatient]));"

Me.DataEntry = False

Me.Requery

End Sub

What I want is to capture the 3 fields on this form, so that they will be
available to carry onto the main Patient Form (as long as 'fEnterPatientInfo'
remains open). I have this working in a similar Access application when
looking up to a 'Patient Lookup' table that has only 3 columns (fields) for
each record, but what I want to do now is pull 3 specific columns from a
record with a lot more than 3 columns (fields).

Thanks.
 

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