What is the "hidden" textbox? Likely this would be something to add to
the
criterion expression for the DLookup function, but I have no idea what
this
textbox is. Post more details and we should be able to help you out.
--
Ken Snell
<MS ACCESS MVP>
Thanks again,
Now if I could ask one more question of you, how would I prevent this
statement in the Control Source for the textbox from returning the
values
using DLookup if the value of the hidden textbox was "1". I am using
this
to
ensure a blank textbox with the default patientID with no name.
Cheers
:
I would use DLookup instead of DLast for this situation, seeing as how
you're filtering using the unique key value.
--
Ken Snell
<MS ACCESS MVP>
Thanks Ken,
Perhaps I am using the wrong statement. I am still learning this as
I
go,
looking for solutions here and elsewhere.
Just to fill you in, I am using the PatientID which is an autonumber
as
the
pointer for the data I need in my form, therefor, I am assuming that
DLast
will always give me what I need as the autonumber is always going to
be
unique. Is this correct, or is there another / better way of pulling
my
data?
Cheers
:
Assuming that DLast indeed works for what you're doing (it's rarely
used
by
most of us):
=DLast("[LastName] & ', ' & [FirstName]","tblPatients","[PatientID]
="
&
[0830])
--
Ken Snell
<MS ACCESS MVP>
I would like to display the lastName and firstName in my text box
which
uses
a DLAST statement based on a hidden textbox value.
I would also like it in the following format:
Smith, John
Is it possible to use the DLAST statement to do this?
This is what I am using so far...
=DLast("[LastName]","tblPatients","[PatientID] =" & [0830])
Thanks in advance