lastName & firstName using DLAST

G

Guest

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
 
K

Ken Snell [MVP]

Assuming that DLast indeed works for what you're doing (it's rarely used by
most of us):

=DLast("[LastName] & ', ' & [FirstName]","tblPatients","[PatientID] =" &
[0830])
 
G

Guest

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


Ken Snell said:
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>

Paul B. said:
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
 
K

Ken Snell [MVP]

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>

Paul B. said:
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


Ken Snell said:
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>

Paul B. said:
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
 
G

Guest

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


Ken Snell said:
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>

Paul B. said:
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


Ken Snell said:
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
 
K

Ken Snell [MVP]

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>



Paul B. said:
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


Ken Snell said:
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>

Paul B. said:
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
 
G

Guest

The hidden textbox holds the PatientID value, it is the [0830] in the
following statement you modified:

=DLast("[LastName] & ', ' & [FirstName]","tblPatients","[PatientID] =" &
[0830])


Does this help?




Ken Snell said:
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>



Paul B. said:
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


Ken Snell said:
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
 
K

Ken Snell [MVP]

Assuming that you're using this in a ControlSource for the textbox:

=IIf([0830] = 1, Null, DLast("[LastName] & ', ' &
[FirstName]","tblPatients","[PatientID] =" & [0830]))


--

Ken Snell
<MS ACCESS MVP>

Paul B. said:
The hidden textbox holds the PatientID value, it is the [0830] in the
following statement you modified:

=DLast("[LastName] & ', ' & [FirstName]","tblPatients","[PatientID] =" &
[0830])


Does this help?




Ken Snell said:
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>



Paul B. said:
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
 
G

Guest

Many Thanks Ken.

Ken Snell said:
Assuming that you're using this in a ControlSource for the textbox:

=IIf([0830] = 1, Null, DLast("[LastName] & ', ' &
[FirstName]","tblPatients","[PatientID] =" & [0830]))


--

Ken Snell
<MS ACCESS MVP>

Paul B. said:
The hidden textbox holds the PatientID value, it is the [0830] in the
following statement you modified:

=DLast("[LastName] & ', ' & [FirstName]","tblPatients","[PatientID] =" &
[0830])


Does this help?




Ken Snell said:
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
 

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