Results 1 to 5 of 5
  1. #1
    Daccess is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2019
    Posts
    7

    Insert data when form field is left lank


    my form requires first and last name but nick name is optional. I want to fill the nick name with first name wherever it is left blank. I’m not sure how to set up an event for this.

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    I would start with trying the form BeforeUpdate event. That way, if the field is bound, you can make the nick name field the same as what the first name field is. Seems like a very odd thing though.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Code:

    Me!NickName = Nz(Me!NickName, Me!FirstName)

    Alternative is to just calculate in query or textbox on report:

    =Nz([NickName],[FirstName])
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Or, if no nick name is supplied, use the FirstName where ever you need to use Nickname--no need to store it twice.

    Logic,
    use Nickname if available, or use FirstName if Nickname is empty.

  5. #5
    Daccess is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2019
    Posts
    7
    That works- thanks

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

Similar Threads

  1. Replies: 7
    Last Post: 09-13-2017, 10:44 AM
  2. Replies: 7
    Last Post: 07-24-2017, 11:47 PM
  3. Replies: 1
    Last Post: 12-28-2016, 11:39 AM
  4. Replies: 1
    Last Post: 04-24-2014, 06:31 AM
  5. Replies: 3
    Last Post: 09-13-2011, 07:58 PM

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