Results 1 to 4 of 4
  1. #1
    Delta729 is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Nov 2010
    Location
    Los Angeles
    Posts
    95

    Main form and subform - pass two separate values

    Hopefully that title makes sense.


    I have a main form called "Task Details" which has a subform called "tblTaskTimes subform". What I'm trying to do is two fold. This portion works fine: It changes the "Status value to "In Progress".

    Private Sub cmdStart_Click()
    Me.Status.Value = "In Progress"
    End Sub

    On the subform is a "Start" field which I'd like to add the Now() function too as well, but I can't figure out how to do this.

    Any help would be appreciated, even pointing towards an article that explains this with examples. (Very much a novice here, so I need examples or I'll never get it.)

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Start button is on the main form?

    If you want to populate field in subform for the current record, code on main form would refer to the subform container. I always name subform container different from the object it contains, like ctrDetails.

    Me.ctrDetails!Start = Now()
    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
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Do you have tables and relationships? If so, can you show us a jpg of you relationships window?

    Always start with a description of the "business" and the underlying "business rules".
    Build a data model; build some test data; validate your data model; then build the database.
    See this link for a basic approach to designing a database.

    Good luck.

  4. #4
    Delta729 is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Nov 2010
    Location
    Los Angeles
    Posts
    95
    OMG, thanks June, you've done it again. That was too easy. Everything I kept finding online was making it way more difficult.

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

Similar Threads

  1. Replies: 1
    Last Post: 09-16-2014, 12:32 PM
  2. Replies: 3
    Last Post: 04-19-2013, 02:57 PM
  3. search main form using the values in the subform
    By haritbhasin in forum Forms
    Replies: 1
    Last Post: 10-23-2012, 11:48 PM
  4. Replies: 1
    Last Post: 05-09-2012, 02:22 PM
  5. Replies: 4
    Last Post: 02-04-2012, 12:51 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