Results 1 to 3 of 3
  1. #1
    MeekoRayne is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2020
    Posts
    5

    Passing Data between Forms and being able to save data changes

    Good Morning,



    I created a Database of co-workers and Tasks. I have a form of task details.. I have another form that lists all of the tasks. What I want to do is make a selection from the Task List where it will then take me to the form of the task details and I can also make changes to that task. I've been able to implement an method OpenArgs statement within those forms, however I'm not able to save the update since the text boxes are no longer linked to the corresponding table. Can anyone help me with this issue?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    the list of tasks would have a button on the form header.
    clicking it would grab the key of the record the cursor is on to open the detail form.

    Code:
    sub btnDetail_Click()
    docmd.openform "fTaskDetail",,,"[TaskID]=" & me.TaskID
    end sub

  3. #3
    MeekoRayne is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2020
    Posts
    5
    This is what I have a originally.

    (Task Lists Form)
    Private Sub txtOpen_DblClick(Cancel As Integer)
    If Me.NewRecord Then 'open form without passing anything in OpenArgs
    DoCmd.OpenForm "frmTask"
    Else 'pass ID Info and name in OpenArgs
    DoCmd.OpenForm "frmTask", , , , , , Me.ID & ";" & Me.Task & ";" _
    & Me.For & ";" & Me.AssignedTo & ";" & Me.StartDate & ";" & Me.EndDate & ";" _
    & Me.CompDate & ";" & Me.CompBy & ";" & Me.Priority & ";" _
    & Me.Description & ";"
    End If

    (Task Details Form)
    Private Sub Form_Load()
    Dim strOpenArgs() As String


    If Not IsNull(Me.OpenArgs) Then
    strOpenArgs = Split(Me.OpenArgs, ";")
    Me.txtID = strOpenArgs(0)
    Me.txtTask = strOpenArgs(1)
    Me.txtFor = strOpenArgs(2)
    Me.txtAssignedTo = strOpenArgs(3)
    Me.txtStartDate = strOpenArgs(4)
    Me.txtEndDate = strOpenArgs(5)
    Me.txtCompDate = strOpenArgs(6)
    Me.txtCompBy = strOpenArgs(7)
    Me.txtPriority = strOpenArgs(8)
    Me.txtDescription = strOpenArgs(9)
    Else
    DoCmd.GoToRecord , , acNewRec
    End If

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

Similar Threads

  1. Passing data betwen forms listbox help
    By PoorBoy in forum Forms
    Replies: 1
    Last Post: 03-07-2013, 11:35 PM
  2. Replies: 1
    Last Post: 03-05-2013, 01:14 PM
  3. Replies: 3
    Last Post: 07-20-2012, 11:55 PM
  4. Passing data between forms
    By injanib in forum Forms
    Replies: 2
    Last Post: 07-01-2011, 09:36 AM
  5. Passing Data Between Forms
    By exeTrix in forum Programming
    Replies: 3
    Last Post: 04-05-2011, 01:06 PM

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