Results 1 to 2 of 2
  1. #1
    carmenv323 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Location
    Massachusetts
    Posts
    78

    Unique Lookup field

    I am trying to figure out a way to default a field on my form

    Example: RequestorName = defaults to system Username on the form and is the "linking field" to the Requestors table (this works find)
    RequestorID = this field exists in the Requestors table and on the form's record source table
    RequestorEmail = this field exists in the Requestors table and on the form's record source table

    I would like to default the form's RequestorID.values and RequestorEmail.value to the values on the Requestors table but the only link is the username.

    Should I be considering this in an after update, on form load or in the table itself?

    All suggestions welcome!



    Thank you

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    In the form's controls (textboxes) properties screen for the RequestorID and RequestorEmail enter a dLookup in the Default Value property:

    =DLookUp("RequesterID","
    Requestors","RequestorName ='" & Environ("UserName") & "'")
    =DLookUp("RequesterEmail","Requestors","RequestorName ='" & Environ("UserName") & "'")

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

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

Similar Threads

  1. Replies: 9
    Last Post: 10-10-2019, 05:13 PM
  2. Replies: 3
    Last Post: 09-26-2017, 11:19 PM
  3. Replies: 4
    Last Post: 03-17-2016, 07:16 AM
  4. Lookup values not appearing in Lookup field?
    By dominover in forum Access
    Replies: 4
    Last Post: 03-05-2016, 05:01 PM
  5. Replies: 3
    Last Post: 05-31-2014, 11:37 AM

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