Results 1 to 3 of 3
  1. #1
    erich_18 is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    11

    subform with two functions.

    Good Day Everyone,



    I'm trying to figure out how to have 1 subform perform various tasks.

    in the parent form (frmInvoiceHeader) the user enters the invoice headers, which is the information on an invoice that does not need to be repeated per item (such as invoice date, invoice number). the information entered is saved in the tblInvoiceHeader Table. the InvoiceNumber is the primary/unique key. The parent form's record source is tblInvoiceHeader

    in the parent form I added a subform (subfrmInvoiceDetails) in datasheet style. the user then inputs data in the subform. this data is saved in another table called tblInvoiceDetails. the subforms record source is tblInvoiceDetails.

    there's a one to many relationship between tblInvoiceHeader and tblInvoiceDetails via the InvoiceNumber.

    up to here everything works fine. the information added in the subform is related with the invoice number created in the Invoice header form. I used a query to verify this and when I look up the invoice number (from a combobox selection on the parent form) it shows all the items (in the query) the user entered in the subform.

    the combobox's (in the parent form) row source is set to InvoiceNumber from tblInvoiceHeader.

    the combobox is unbound.

    what I would like is for the user to be able to select an invoice number from the combobox and all the records related to that invoice number is populated in the subform. but not only to see the data but also to edit, delete, add new items if needed.

    its like going back to a previous invoice to browse and make changes if needed.

    is it possible to have a subform perform these 2 tasks? 1. query and 2. edit, update, add, delete..etc)

    attached an image of my form and an image of the query results from the combobox selection.

    Click image for larger version. 

Name:	Untitled.jpg 
Views:	8 
Size:	66.4 KB 
ID:	36390
    Click image for larger version. 

Name:	Untitled2.jpg 
Views:	8 
Size:	48.2 KB 
ID:	36391
    and the invoice number relationship

    Click image for larger version. 

Name:	Untitled3.jpg 
Views:	8 
Size:	59.9 KB 
ID:	36392

    tks.

    Eric

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Are you saying you cannot append or edit details? From the fantastic description/details you've provided, it seems you've done everything correctly and should be able to do so. There would of course, be some exceptions, such as if the forms were based on queries that are not updatable, you opened the form as read only, or the form records were based on a snapshot recordset. I'm not seeing any evidence of those things. The design view of the query may have been better, rather than its datasheet view because it seems you based main form on a table and the subform on a query. The query may be the problem if you can't update or append to the form. In that case, I'd open the query itself to see if it's updatable. If not, then that's the issue. If it is but the form is not, then there's some other issue.
    Last edited by Micron; 12-02-2018 at 01:13 PM. Reason: spelin and gramur
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    Your descriptions of the forms and table names do not match the images you provided, so it's hard to make any analysis. Your description is viable, but the images don't reflect the words.

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

Similar Threads

  1. Functions
    By Khalil Handal in forum Modules
    Replies: 3
    Last Post: 06-02-2018, 02:22 PM
  2. Replies: 9
    Last Post: 10-29-2015, 02:46 AM
  3. Help with functions
    By cc.caroline15 in forum Programming
    Replies: 5
    Last Post: 02-04-2015, 08:26 PM
  4. Functions
    By Alex Motilal in forum Programming
    Replies: 2
    Last Post: 09-27-2010, 08:06 AM
  5. Functions
    By jamin14 in forum Programming
    Replies: 1
    Last Post: 03-25-2010, 08:16 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