Results 1 to 3 of 3
  1. #1
    dgtampa is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2011
    Posts
    28

    Default value from separate table

    Hello all,

    I have a form named "frmLevel_Review," which contains controls named "txtBeneficiary_Name," "txtReview_Date," and "txtCurrent_Level," whose row source is a table named "Level_Review."



    What I need on the form is the default value for the control "txtReview_Date" to be the value from a field named "Admit_Date" on a separate (but related) table called "Beneficiaries." I would like this to happen after the user selects a name from the control "txtBeneficiary_Name."

    The idea is that the form will 1) automatically populate the "txtReview_Date" with a Beneficiarie's admit date for new records while 2)allowing the user to update existing records with a new review date (note: I do not want the updates to cascade back to the "Admit_Date" in the table "Beneficiaries"; I only want the updates to apply to records in the source table for "frmLevel_Review."

    I have attached a relationship report if anyone needs to review it...

    This is my first post here, so I apologize in advance if I am not posting correctly
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    This will require code. I use only VBA.

    Use the AfterUpdate event of txtBeneficiary to get the Review_Date and set the field. One way is:

    If IsNull(Me!Review_Date) Then
    Me!Review_Date = DLookup("Admit_Date", "Beneficiaries", "ID=" & Me.txtBeneficiary)
    End If

    Suggest the txtBeneficiary control be a combobox with a RowSource that queries the Beneficiaries table.
    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.

  3. #3
    dgtampa is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2011
    Posts
    28
    Thank you sooo much June7! That did the trick!

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

Similar Threads

  1. Replies: 12
    Last Post: 12-14-2011, 08:04 PM
  2. New user - separate a table into two tables
    By Henry_Reimer in forum Database Design
    Replies: 19
    Last Post: 10-08-2011, 10:19 PM
  3. Replies: 1
    Last Post: 09-11-2011, 06:14 PM
  4. Table opening by default
    By rod147 in forum Access
    Replies: 1
    Last Post: 07-07-2009, 10:01 AM
  5. Default Value in table = Field plus 3 days
    By AmyLynnHill in forum Access
    Replies: 1
    Last Post: 08-03-2008, 01:58 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