Results 1 to 14 of 14
  1. #1
    cbenisch is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    28

    Access - New record in non-linked subform


    I have an access form that has a marco button to open another form using a filter that returns records in the new form that have a matching recordID field from the main form. This works fine.

    I want to be able to add records to the table which works as well only the recordID field is not populated with the id field used in the filter from the main form. How can I populate the recordID field with that of the master filed from the main form? It is just blank on the new records created now.

    I expect this is easy to resolve and I am just not seeing it.

    Thanks in advance for any help.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    You can set the default value property of the subform textbox to the one on the main form. That way new records will get the same ID.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    cbenisch is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    28
    I appreciate the quick response but that does not seem to resolve the issue.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Can you post the db with it not working?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    cbenisch is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    28
    I am still working with it now. It may be an issue with getting the control name entered correctly. Here is what I set the default to " =[Forms]![Facility Information]![txtFMLID] "

    Here is result

    Click image for larger version. 

Name:	Capture.JPG 
Views:	9 
Size:	12.8 KB 
ID:	9991

  6. #6
    cbenisch is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    28
    I am not able to make this work. I cannot post the database in post to the forum because of the data it contains. Removing the data would be very time consuming.

    I have a folow up question though. Is it possible to create a subform that opens in a new window rather than being part of the main form? If I have a liked subform it works fine but I would like it to open a new window rather than having it as link subform. I have several forms I want to open and add records to from the main form.

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    This works for me:

    =[Forms]![frmTripSheetMain]![txtFromDate]

    so make sure the form and control names are correct, and of course the form must be open. You can certainly create a form that opens on its own. It would no longer be a "subform", since at that point it would not be within another form.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    cbenisch is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    28
    Seems to be an issue with the main form being used in navigation form. If I open the main form directly it works. If I use the main form from the navigation form in 2010 it does not work.

  9. #9
    cbenisch is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    28
    Tried changing it to =[Forms]![Navigation Form]![NavigationSubform].[Form]![tbxFMLID] so that it is referncing the form in the Navigation form but that does not work either.

    Thoughts?

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Hard to say without seeing it. Have you tried the Build function from the default value property? That would let you navigate to it and let Access create the syntax.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #11
    cbenisch is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    28
    That is what i did to get the syntax listed above.

  12. #12
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Sorry, but I'm stumped. I haven't used the navigation form feature, so perhaps there's some quirk with it. If you get time to put together a sample to play with, I'll try to figure it out.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  13. #13
    cbenisch is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    28
    I pinged the MS office_2010-access forum about the navigation issue and found a thread wit what seems to be the same issue and there is no resolution yet. Here is the link

    http://answers.microsoft.com/en-us/o...4-8bdf6852af13

    Thanks for the help. May just have to bail on using the navaigation.

  14. #14
    cbenisch is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    28
    As to a sample I am guessing you could drop your existing form onto a navigation form and it would fail the same way. That is all I did to get to where I am now.

    Thanks again for the time you did spend on this.

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

Similar Threads

  1. Replies: 6
    Last Post: 08-22-2012, 03:24 AM
  2. Form and Subform not linked
    By Marianna_Air in forum Forms
    Replies: 4
    Last Post: 08-13-2012, 09:35 AM
  3. combo box linked to subform
    By gbmarlysis in forum Forms
    Replies: 1
    Last Post: 02-01-2012, 02:28 PM
  4. Linked Table in SubForm
    By jamphan in forum Forms
    Replies: 1
    Last Post: 01-24-2011, 02:01 PM
  5. subform fails with linked tables
    By byterbit in forum Forms
    Replies: 4
    Last Post: 11-02-2010, 07:47 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