Results 1 to 11 of 11
  1. #1
    pritesharyan is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2015
    Location
    India
    Posts
    32

    Post Automatically adding/expanding new row in MS Access forms

    I am trying to build an invoice form in which the user has to select an item and when ever the item is selected from the combo box, a new blank row should be added at bottom as shown in the screen shot below.


    Click image for larger version. 

Name:	Invoice.jpg 
Views:	37 
Size:	119.2 KB 
ID:	19807



    I have seen that the Northwind sales database has done same thing but I don't know how to implement it.
    As per my search, they have build form (below screen shot) and put it in Order Detail (Subform),
    but what is the logic behind automatically adding of new row at last?
    Click image for larger version. 

Name:	sub form 1.jpg 
Views:	36 
Size:	32.2 KB 
ID:	19808

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    if you're using a bound form as soon as you enter ANY value in a 'blank' record a new record should be displayed. There's no special code to get it to do it, it's the default behavior.

  3. #3
    pritesharyan is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2015
    Location
    India
    Posts
    32
    Thank you so much for fast replying.
    as i am beginner please what is bound form??
    sorry if this is a silly question

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    A bound form is a form that is based on a query or table as the RECORD SOURCE
    an unbound form is a form that has no RECORD SOURCE and data manipulation is handled by code or queries.

  5. #5
    pritesharyan is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2015
    Location
    India
    Posts
    32
    @rpeare
    i have tried bound form but could't succeed.
    does it only works in subform?
    Download what i have tried
    Click image for larger version. 

Name:	Automatically Adding new row.jpg 
Views:	32 
Size:	97.0 KB 
ID:	19817

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Forms can be set as Single View, Datasheet View, Continuous View in the Default View property. You have the form set to Single View. Use Navigation Controls at bottom of form to move to new record row or change the view setting.

    Have you studied an introductory tutorial book?
    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.

  7. #7
    pritesharyan is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2015
    Location
    India
    Posts
    32
    @June7
    I am not trying to just going to new record
    when ever i add new record new combo for Test ID and Two new Text Box for TestName and TestAddress should be created respectively.
    see the customer order form in my Question, whenever new Product selected from combo box new delete button,Combo for(product name), five Text Boxes for Quantity, Unit price, Discount, Total Price, Status will be created.
    Please guide me.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Not sure what you are asking for. Before creating forms and reports, need to get the data structure defined. The posted db has only one table.

    The Northwind image shows a form/subform arrangement. What is it you don't understand about form/subform?

    The new record row automatically displays with form in Datasheet or Continuous view. In Single View, click the navigation button at bottom of form to go to new record.
    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.

  9. #9
    pritesharyan is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2015
    Location
    India
    Posts
    32
    @June7
    See the below screen shot
    Download Northwind sales web database for referance.
    Click image for larger version. 

Name:	Automatically Adding new row 1.jpg 
Views:	33 
Size:	228.0 KB 
ID:	19821

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    This is normal behavior of form set for Datasheet view. If you want Quantity, UnitPrice, Discount, TotalPrice, Status 'columns' then create textboxes on form. Set DefaultValue property.

    TotalPrice will have an expression in ControlSource to calculate: =[Quantity] * [UnitPrice]

    UnitPrice can be automatically populated with an expression that references a column of the Product combobox: =[Product].[Column](1)

    For multi-column combobox, review http://www.datapigtechnologies.com/f...combobox3.html

    This is all very basic Access functionality.
    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.

  11. #11
    pritesharyan is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2015
    Location
    India
    Posts
    32
    Thank you so much @june7
    Here is what I Want to achieve and finally achieved
    once again thank you so much @June7 and @rpeare

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

Similar Threads

  1. form with expanding/shrinking sub-forms?
    By benjammin in forum Forms
    Replies: 19
    Last Post: 02-02-2015, 02:52 PM
  2. Replies: 5
    Last Post: 09-28-2013, 05:48 PM
  3. Replies: 3
    Last Post: 12-12-2012, 01:13 AM
  4. expanding access database
    By sloppyjoe778 in forum Access
    Replies: 8
    Last Post: 12-12-2011, 12:13 AM
  5. Automatically Adding New Data to Tables
    By aquarius in forum Import/Export Data
    Replies: 1
    Last Post: 09-15-2010, 07:27 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