Results 1 to 8 of 8
  1. #1
    marisacoul is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jun 2017
    Posts
    27

    Question FirstName, LastName, or Untitled on the header of a form

    Hi,

    Would like the header of my form to read "FirstName LastName" when inputted or "Untitled" when no value.

    I have a Query called "Query ContactName" where I define "Contact Name" as Contact Name: [FirstName] & " " & [LastName]. Then on the header of my form I have =Nz([Contact Name],"Untitled"),which I thought should work. But when I open the form (the form is set to open on a blank form) only Untitled comes up, regardless of whether it is a blank or filled-in entry.

    Please help! The frustration is real.



    Marisa

  2. #2
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,463
    Put the code =Nz([Contact Name],"Untitled") in the OnCurrent event of the form so it will work as you move through records. If you open on a blank record that yes you would get Untitled when it opens.

  3. #3
    marisacoul is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jun 2017
    Posts
    27
    Hi,

    Thanks for your quick reply! I copied and pasted your code into the OnCurrent event slot and I'm still getting only Untitled for every entry. Stumped!

    Is there anything in particular I should put in the header of the form?

    Also: I'm getting an error message for the code I used to get it to open to a blank form, so I removed it. How do i get the form to open to a blank entry, without changing Data Entry to "Yes"? This prevents me from searching through records.

    Marisa

  4. #4
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,463
    Are you using a combo box to select the specific record for the form? So the query as the RecordSource of the form has the Contact Name field?

  5. #5
    marisacoul is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jun 2017
    Posts
    27
    Hi, yes, there is a drop down combobox on the form that lists all the entries, and you can use that to navigate. But the columns for the combo box are "First Name", "Last Name", and "Email". The record source for the form is a table called "Family Story list". This table actually has a Contact Name field but nothing is coming up inside, which is odd...

    Marisa

  6. #6
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Is this a split form or form/subform or something else?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    marisacoul is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jun 2017
    Posts
    27
    I'm sorry, but I don't actually know. I'm working from a template and didn't actually build the form. When I click properties it says "form (local)"? How can I check what kind of form it is?

  8. #8
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Open it in design view. If the property sheet is not visible, Ribbon > Design tab, Tools section - property sheet. The Format tab of the property sheet will tell you if it's single, split or what. That won't tell you if it's a form/subform, but looking at the form in design, you'd see what looks like another form on the form. Perhaps you'd see "form header" and "detail" more than once.
    (the form is set to open on a blank form) what does this mean to you? I can't help but wonder if you're basing the form on a record source but going directly to a new record somehow. In that case, I don't see how it could ever show anything but "Untitled" when you open the form. Navigating to an existing record and not showing the name at best, or an error at worst, sounds like another issue that may or may not be related.

    If you can't solve it based on all the responses at this point, consider zipping a copy of the db and posting here for analysis. You can maintain data privacy by replacing "Smith" for example, with any word at all.

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

Similar Threads

  1. Replies: 1
    Last Post: 02-02-2015, 12:35 AM
  2. Replies: 7
    Last Post: 07-11-2013, 10:27 AM
  3. Full Name from FirstName LastName
    By jhrBanker in forum Forms
    Replies: 14
    Last Post: 06-23-2013, 03:12 PM
  4. FirstName + LastName
    By mehulkar in forum Access
    Replies: 1
    Last Post: 07-28-2011, 01:40 PM
  5. Concatenate firstname + lastname
    By Dega in forum Access
    Replies: 2
    Last Post: 08-11-2010, 04:58 PM

Tags for this Thread

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