Results 1 to 6 of 6
  1. #1
    mike02 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    245

    combing two text box values into one label

    I have two text boxes, and i want to make there value be the label for the form. Here is what i have in the Label on the form:

    =Nz([Last Name] And [First Game],"Untitled")



    Where am i going wrong?

    Thanks,

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    You would need to set the "Caption" property of the form or a label on the form using the forms On Current event. Perhaps something like:
    Me.Caption =Nz([Last Name] & " " & [First Name],"Untitled")
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    mike02 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    245
    I didnt need to set any caption property, i just used your syntax in the formula and it worked like a charm!

    Thanks!

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    Quote Originally Posted by mike02 View Post
    I didnt need to set any caption property, i just used your syntax in the formula and it worked like a charm!

    Thanks!
    So where exactly did you use the expression. I'm just curious.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    mike02 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    245
    in a Label, I have a combo box searching on the Form, and I wanted a Label On the header of the form that brought up the Name of the Client:

    [ LastName , FirstName ] (Label)

    This is the formula i just typed in the label:

    =Nz([Last Name] & "," & [First Name],"Untitled")

    [Last Name] and [First Name] are Text boxes on the form. So when i search it takes the value in each text box and puts them together in the Label

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    For the benefit of any others that read this thread:
    In Access versions up to and including A2003 it is not possible to use an expression like this directly in the label. The way to do it was to set the labels caption property, usually in one of the forms events (e.g. On Current)
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 04-24-2013, 08:50 AM
  2. Update Label from Text Box
    By rcdeck in forum Forms
    Replies: 2
    Last Post: 01-30-2013, 11:22 AM
  3. How to use lookup table values in a form as a Label
    By MP BILL in forum Database Design
    Replies: 12
    Last Post: 08-09-2012, 06:13 PM
  4. click label -> append text to texbox
    By cnstarz in forum Access
    Replies: 5
    Last Post: 06-15-2011, 06:09 AM
  5. Replies: 1
    Last Post: 03-29-2009, 08:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums