Results 1 to 8 of 8
  1. #1
    sireesha is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    50

    i want to store mainform fields in the table.

    In access 2007, I have a mainform and subform. subform is in datasheet view. these fields are saving into the table. but in mainform also i have 2 fields to be saved into same table. how to save mainform fields.

    Please help me as early as possible

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    Why would you want to save the data to the sub forms table if the data is already in the table of the main form.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    sireesha is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    50
    Quote Originally Posted by Bob Fitz View Post
    Why would you want to save the data to the sub forms table if the data is already in the table of the main form.

    in the mainform fields data is automatically fill from listbox from other tables. but 2 fields need to store in the subforms table. how?

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    Perhaps you could achieve this with code in the subforms Before Update event. Something like:
    Me.[SubControlName1] = Parent.[MainControlName1]
    Me.[SubControlName2] = Parent.[MainControlName2]

    Substitute SubControlName1 and SubControlName2 with the names of the controls on the sub form.
    Substitute MainControlName1 and MainControlName2 with the names of the controls on the main form.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    sireesha is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    50
    Quote Originally Posted by Bob Fitz View Post
    Perhaps you could achieve this with code in the subforms Before Update event. Something like:
    Me.[SubControlName1] = Parent.[MainControlName1]
    Me.[SubControlName2] = Parent.[MainControlName2]

    Substitute SubControlName1 and SubControlName2 with the names of the controls on the sub form.
    Substitute MainControlName1 and MainControlName2 with the names of the controls on the main form.
    Mainform controls Directly stored into table fields when i click on save button subform fields are saving in the table as well as mainform control(2 controls) also saved into the table fields.. i don't have any controls in subform related to maincontrols. so i want to store the values automatically with subform fields.

  6. #6
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    The Main Form shows One Record from a Table.

    The Sub Form can show many records from a different Table.

    If you were displaying One Record in the Main Form. (There is no other choice)

    Then you displayed 29 Records in the Sub where you you want to store these Two Fields.

  7. #7
    sireesha is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    50
    subform is datasheet view when i enter the data in these fields stored into table(this form fields are saved inthis table). in the mainform purchase_id and notes two textboxes are there. in the purchase_id textbox the value come from listbox from other tables. and in the notes textbox when i enter the data this data and purchase_id value will be stored into table. these two textboxes are in mainform. i assigned to these controlsource property but these are not saved into table how to save.

  8. #8
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    I can't understand what you are trying to do.

    Please post a copy of your Database. Cut it down and only show what we need to see.

    Please post in A 2003.

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

Similar Threads

  1. Replies: 1
    Last Post: 04-17-2012, 12:27 PM
  2. How to make Parent field store sum of child fields
    By Alexandros in forum Database Design
    Replies: 10
    Last Post: 03-19-2012, 10:41 AM
  3. How can i store expressions in table?
    By smahdih in forum Access
    Replies: 9
    Last Post: 10-28-2011, 05:32 AM
  4. Replies: 1
    Last Post: 07-25-2011, 08:27 AM
  5. How to store data many row in one table
    By dododo in forum Access
    Replies: 4
    Last Post: 06-25-2011, 12:42 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