Results 1 to 4 of 4
  1. #1
    RoadRunner123456 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2013
    Posts
    3

    Subform Control

    I have a set of forms that are similiar to a five page application. I am trying to get a button to activate from the main form to go to the Subform Page. If there is no record is should open to a new record otherwise it should go to the exisitng record.

    The main form is linked to a Main table and each of the Subforms are linked to to their own table with a common key to join to the main table.

    Right now my button on the main form code work fine for the existing records but it does not default to new: Need a little help here for the next step to set controls for the new records???

    Private Sub Toggle_120_Click()
    Dim strDocName As String
    Dim strWhere As String


    strDocName = "Grassfed_Entry_Form"
    strWhere = "[ID]=" & Me!ID
    DoCmd.OpenForm strDocName, acNormal, , strWhere
    End Sub

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Don't understand the code. Is Toggle_120 a control on main form? Is Grassfed_Entry_Form a subform? Can't 'open' a subform that sits on a main form.
    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
    RoadRunner123456 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2013
    Posts
    3

    Subform control

    Quote Originally Posted by June7 View Post
    Don't understand the code. Is Toggle_120 a control on main form? Is Grassfed_Entry_Form a subform? Can't 'open' a subform that sits on a main form.
    I have a toggle button on the main form#120, this is to go to the subform that is related to the Main Table through a key on the subform table. Because there are so many entry fields on the main form and the associated five subforms they need to have thier own separate page views. What I want to do is use a toggle button to go to the subform "Grassfed Audit" and either open the already exisitng date if any or if not data exists to open up a blank form in data entry mode. I have tried this using at designer toold to create the subform on the main form but it is entirely to cluttered when you have all five data entry screesn. Bewteen the main form table and the subform table there are about 125 fields for data entry. so by breaking it up into the main form with five subforms it will make it less cluttered.


    The above toggle button commands, take the Main form Id and set its value so the subform can open with the data set related to the linked key so I know I have it partly set up. but lack how to get it to open in new record mode when it can not find a matching record.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Totally confused, don't understand what you describe. If the main form is bound to a primary data table and subforms are bound to 5 related dependent tables, the records should synchronize. If there aren't any related records then the subform(s) will be on a new record row. Are the subforms in single or continuous or datasheet view?
    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.

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

Similar Threads

  1. Replies: 10
    Last Post: 02-20-2013, 07:04 AM
  2. Replies: 3
    Last Post: 03-29-2012, 12:40 PM
  3. Replies: 3
    Last Post: 03-02-2012, 03:27 PM
  4. Hide each control, control group or subform?
    By BRV in forum Programming
    Replies: 2
    Last Post: 12-09-2011, 09:36 AM
  5. Replies: 5
    Last Post: 10-13-2011, 03:36 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