Results 1 to 3 of 3
  1. #1
    asmith533 is offline Novice
    Windows Vista Access 2007
    Join Date
    Sep 2012
    Posts
    13

    Carrying request ID and Customer Info into a new frm from existing frm using a button


    I have a database that collects customer requests and customer feedback among other information. The issue I have is that not every request has feedback and not every feedback is the result of a request, therefore requiring the two seperate tables. I've created two forms, one for requests (Frm_CustomerRequest) and one for feedback (Frm_CustomerFeedbackCR). I'm not the best at programming and I need some help on how to carry the customer information and the request ID over into the feedback form from the request form by clicking the "Add Feedback" button. I've attached the database structure in a zip file.
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    You have an embedded macro for the button code, I use only VBA. I don't know if macros can accomplish what I suggest.

    I would use the OpenArgs argument of OpenForm to pass info to the Feedback form and then have the Feedback form grab data from the open Request form.

    Sub Feedback_Click()
    DoCmd.RunCommand acCmdSaveRecord
    DoCmd.OpenForm "Frm_CustomerFeedbackCR", acNormal, "", "", acFormAdd, acNormal, "Request"
    End Sub

    Then in Current event of Feedback form:

    Private Sub Form_Current()
    If Me.OpenArgs = "Request" Then
    Me.TblFeedback_Request_ID = Form_Frm_CustomerRequest.TblRequest_ID
    Me.TblFeedback_Customer_ID = Form_Frm_CustomerRequest.TblRequest_Customer_ID
    End If
    End Sub

    Or you can even pass the ID info in the OpenArgs and parse them:

    DoCmd.OpenForm "Frm_CustomerFeedbackCR", acNormal, "", "", acFormAdd, acNormal, Me.TblRequest_ID & ":" & Me.TblRequest_Customer_ID

    Private Sub Form_Current()
    If Len(Me.OpenArgs) > 0 Then
    Me.TblFeedback_Request_ID = Left(Me.OpenArgs, InStr(Me.OpenArgs,":")-1)
    Me.TblFeedback_Customer_ID = Mid(Me.OpenArgs, InStr(Me.OpenArgs,":")+1)
    End If
    End Sub
    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
    asmith533 is offline Novice
    Windows Vista Access 2007
    Join Date
    Sep 2012
    Posts
    13
    That worked perfectly! Thanks!!!

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

Similar Threads

  1. More Info" button based on Combo Box selection
    By kriskeven in forum Access
    Replies: 1
    Last Post: 05-21-2012, 02:23 PM
  2. Replies: 4
    Last Post: 02-07-2012, 12:16 PM
  3. Replies: 1
    Last Post: 12-24-2011, 08:48 AM
  4. Replies: 5
    Last Post: 09-14-2011, 03:41 PM
  5. Replies: 3
    Last Post: 11-02-2010, 10:15 AM

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