Results 1 to 5 of 5
  1. #1
    andresdm is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2013
    Posts
    6

    New Comment Form - Autopopulating Certain Fields


    Hello,

    I have a claims log. In my claims log, i have a button that takes me to an "add comment" form. When I click the button, it takes me add a new record on the comments form.

    I want the Claim ID on the claims log form to populate in the Claim ID on the new record Comments form. I also want the entry date to auto populate with today's date.

    how do I do this?
    Click image for larger version. 

Name:	Claim Form 1.png 
Views:	8 
Size:	32.4 KB 
ID:	11660Click image for larger version. 

Name:	Claim Form 2.png 
Views:	7 
Size:	7.7 KB 
ID:	11661

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    For the date just use a default value of Date(). For the other, right after opening the form:

    Forms!FormName.ClaimID = Me.ClaimID

    using the correct names.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    In the original Form, with the Command Button named Go2CommentsForm

    Code:
    Private Sub Go2CommentsForm_Click()
    
    If Not IsNull(Me.ClaimID) Then
      DoCmd.OpenForm "CommentsForm", , , , , , Me.ClaimID
     Else
      MsgBox "A Claim ID Must Be Entered First!"
    End If
    
    End Sub

    In the Comments Form

    Code:
    Private Sub Form_Load()
    
    If Not IsNull(Me.OpenArgs) Then
      DoCmd.GoToRecord , , acNewRec
      Me.ClaimID = Me.OpenArgs
      Me.EntryDate = Date  
    End If
    
    End Sub

    Linq ;0)>

  4. #4
    andresdm is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2013
    Posts
    6

    it worked :)

    Quote Originally Posted by pbaldy View Post
    For the date just use a default value of Date(). For the other, right after opening the form:

    Forms!FormName.ClaimID = Me.ClaimID

    using the correct names.

    THIS WORKED!!! Thanks!

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Duplicate Comment into all records
    By Marianna_Air in forum Forms
    Replies: 22
    Last Post: 08-22-2012, 08:04 PM
  2. Help with autopopulating a form
    By chulo in forum Forms
    Replies: 7
    Last Post: 02-20-2012, 03:57 PM
  3. subform not autopopulating
    By slimjen in forum Forms
    Replies: 32
    Last Post: 09-21-2011, 01:55 PM
  4. Autopopulating Forms
    By daniel.e.john in forum Access
    Replies: 3
    Last Post: 09-09-2011, 07:19 PM
  5. Comment History
    By botts121 in forum Programming
    Replies: 0
    Last Post: 07-02-2009, 01:02 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