Results 1 to 4 of 4
  1. #1
    bluezidane is offline Novice
    Windows Vista Access 2002
    Join Date
    Aug 2010
    Posts
    4

    update field from one subform to another

    Hi


    I am sorry if this is a very basic question but I have learnt all I know about Access (which isn't very much) by trial and error and internet searches. However this one has me stuck.

    I have a form "supportindivfrm" which uses an ID field from my main table "supporttbl" to link the details of the different times we provide support to clients to the individual clients. What I want to do is open up a new form "supportindivdetailadd" from the supportindivfrm which updates the ID field in the new form "supportindivdetailadd" from the ID field in "supportindivtbl". Does that make any sense at all?

    If anyone was able to suggest the code I need to do this and tell me where to put it, I would be immensely grateful.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Here's my suggestion: http://www.baldyweb.com/OpenArgs.htm

  3. #3
    bluezidane is offline Novice
    Windows Vista Access 2002
    Join Date
    Aug 2010
    Posts
    4

    still stuck!

    Many thanks for the information. I have given it a shot but still not getting it quite right I fear. The code I have now on the 'on click' button for opening up the supportindivdetailadd form is:

    Private Sub Command302_Click()
    On Error GoTo Err_Command302_Click

    Dim stDocName As String
    Dim stLinkCriteria As String
    stDocName = "supportindivdetailadd"

    stLinkCriteria = "[ID]=" & Me![Text299]
    DoCmd.OpenForm stDocName, , , stLinkCriteria
    DoCmd.OpenForm "supportindivdetailadd", , , , , , Me.ID & ";" & Me.ID

    Exit_Command302_Click:
    Exit Sub

    Err_Command302_Click:
    MsgBox Err.Description
    Resume Exit_Command302_Click

    End Sub

    (The ID field is Text299 on the first form and Text4 on the second but even trying those options didn't make it work any better). Any further help would be much much appreciated.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You only need one OpenForm command passing the value that you catch in the OnLoad event of the next form. As the link shows, you then place that value into a bound control on the next form if you want to alter the the RecordSource of the next form.

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

Similar Threads

  1. Replies: 2
    Last Post: 05-05-2010, 02:52 PM
  2. Replies: 3
    Last Post: 02-10-2010, 07:29 AM
  3. update recordsource of subform
    By AndyKim in forum Forms
    Replies: 1
    Last Post: 06-16-2009, 09:15 AM
  4. Failed to update all field
    By somya123 in forum Queries
    Replies: 0
    Last Post: 01-30-2009, 12:52 AM
  5. Form/Subform - Update control help!
    By f_ali in forum Forms
    Replies: 2
    Last Post: 02-26-2006, 12:59 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