Results 1 to 3 of 3
  1. #1
    epardo87 is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Dec 2016
    Posts
    101

    Enter data into a continuous subform through a button

    Hi there,
    Its been a while since I had to use access and I've forgotten about everything. So please consider me as a newbie.


    So I have a form "POS" which has fields from "Sales" table and I have a continuous sub-form that shows the products of the Sales orders "SaleDetailSF". It works fine showing me existing records. What I need now is to create a new record, I have set the form to data entry "Yes". it also works fine if I just wanted to add the products directly clicking on the combobox field within the subform.
    The thing is that I have some buttons on the parent form, each button represents a product (users will be using a touchscreen), so what I would like is that each click on the button fills up the "Product" combobox within the subform (both forms are already linked by SO number) and every other button click should fill a new record in the subform. I've been looking for ways to do it but examples in tutorial are not very helpful with this specific purpose.

    I'll appreciate any help I can get on this

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Form does not need DataEntry property set to Yes in order to enter new record. If the new record row is available, just go to that row.

    So with each button click you need to move to new row and populate product field. With code behind main form in button click event:

    Me.subformcontainername.SetFocus
    DoCmd.GoToRecord , , acNewRec
    Me.subformcontainername.Form.comboboxname = appropriate product ID here.
    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
    epardo87 is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Dec 2016
    Posts
    101
    Thank you!!
    This worked great!

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

Similar Threads

  1. Replies: 21
    Last Post: 01-31-2022, 01:09 PM
  2. Replies: 13
    Last Post: 02-05-2018, 12:58 PM
  3. Subform will not allow me to enter data
    By MLangendorf in forum Forms
    Replies: 5
    Last Post: 08-25-2016, 10:02 AM
  4. Replies: 3
    Last Post: 11-25-2012, 06:09 PM
  5. I can't enter data into a subform
    By MichealShinn in forum Forms
    Replies: 4
    Last Post: 06-19-2012, 11:18 AM

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