Referencing field values in a label

R

Ryan Langton

With an .mdb, syntax of " = [fieldName] " for a label would cause the value
of the field to show up as the label. How do I do this with .adp?

Thanks,
Ryan
 
R

Ryan Langton

Hmmmm.. I thought this would be an easy one. Maybe my wording was
confusing. As an example, I have an .mdb Form that has a label (LabelA).
This LabelA has a value of "=[LastName] & ", " & [FirstName]". On the form
this displays as a regular label with a value of Langton, Ryan (if I was the
current record selected). Is there any way to do this with .adp? It
doesn't seem to be able to access the record values. "=[LastName] & ", " &
[FirstName]" shows up exactly as "=[LastName] & ", " & [FirstName]" on an
..adp form.

Ryan
 
B

Brendan Reynolds

I think you'll find that that 'label' is a text box formatted to look like a
label.

To do it with a label, you'd have to use code ...

Private Sub Form_Current()

Me!LabelA.Caption = Me!LastName & ", " & Me!FirstName

End Sub

--
Brendan Reynolds (MVP)


Ryan Langton said:
Hmmmm.. I thought this would be an easy one. Maybe my wording was
confusing. As an example, I have an .mdb Form that has a label (LabelA).
This LabelA has a value of "=[LastName] & ", " & [FirstName]". On the
form this displays as a regular label with a value of Langton, Ryan (if I
was the current record selected). Is there any way to do this with .adp?
It doesn't seem to be able to access the record values. "=[LastName] & ",
" & [FirstName]" shows up exactly as "=[LastName] & ", " & [FirstName]" on
an .adp form.

Ryan

Ryan Langton said:
With an .mdb, syntax of " = [fieldName] " for a label would cause the
value of the field to show up as the label. How do I do this with .adp?

Thanks,
Ryan
 
R

Ryan Langton

Thanks Brendan,
That code worked beautifully!

Brendan Reynolds said:
I think you'll find that that 'label' is a text box formatted to look like
a label.

To do it with a label, you'd have to use code ...

Private Sub Form_Current()

Me!LabelA.Caption = Me!LastName & ", " & Me!FirstName

End Sub

--
Brendan Reynolds (MVP)


Ryan Langton said:
Hmmmm.. I thought this would be an easy one. Maybe my wording was
confusing. As an example, I have an .mdb Form that has a label (LabelA).
This LabelA has a value of "=[LastName] & ", " & [FirstName]". On the
form this displays as a regular label with a value of Langton, Ryan (if I
was the current record selected). Is there any way to do this with .adp?
It doesn't seem to be able to access the record values. "=[LastName] & ",
" & [FirstName]" shows up exactly as "=[LastName] & ", " & [FirstName]"
on an .adp form.

Ryan

Ryan Langton said:
With an .mdb, syntax of " = [fieldName] " for a label would cause the
value of the field to show up as the label. How do I do this with .adp?

Thanks,
Ryan
 

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