Results 1 to 6 of 6
  1. #1
    MacMan is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2015
    Posts
    8

    Creating a subform for input to a table

    I need to be able to create a form that a clerk can enter a new sale ticket number into and then in the subform list the items being sold. The table record would contain the following fields.


    TicketNumber
    Consignor
    Unit Price
    and could include the Unit Total (Can be calculated at time of entry or when generating reports.

    Later a couple of reports will be generated (Already built) That can validate the ticket by ticket. Provide a report by Consignor for all of the items sold by that consignor and a Total sales report that would show all consignors, their totals, the commission and the final check total.

    I have built a form with this information but it shows all of the data already in the table . How do I set the form up so it is just for data entry?

    I have a system set up so I can provide it if you need to see what I am talking about here. It is 1.5 Meg so I can't include it with this post.

    Thanks in advance for your help..

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    2MB zip file can be attached to post. Use Windows Compression.

    If form DataEntry property is set to Yes then the form will only allow new record entry. However, I prefer to set this condition when opening the form by a button click:

    DoCmd.OpenForm "form name", , , , acFormAdd

    This allows one form to serve multiple purposes. I could open it from a different button to view existing record(s):

    DoCmd.OpenForm "form name", , , "ID=" & Me.tbxID
    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
    MacMan is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2015
    Posts
    8

    Creating a subform for input to a table

    June7 Thank you for your response.

    CCE1.zipI tried the Data Entry mode but that didn't seem to work. File attached

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Don't understand data structure. How can a ticket have more than one consignor?

    Need to set subform container control Master/Child Links properties.

    You have autonumber ID field in Tickets set as primary key but you are saving TicketNo as foreign key in InputFile. Either set TicketNo as primary key or save the ID as foreign key.
    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.

  5. #5
    MacMan is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2015
    Posts
    8
    A ticket is a sales slip which will have multiple items that a client wants to buy. Each Item could have different Quantities will be from a consignor. For example I buy 3 different items but one of them I buy 2 of the same thing. So the ticket would have three items listed, 2 would be a quantity of 1 and 1 would have a quantity of 2.

    I reset the Ticket Table Field Ticket to be the primary key, but in saving I get an error "Index or primary key cannot contain a Null Value. "

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Many readers are not familiar with your environment and do not understand how your business is set up. It would help readers and you, if you could give us a 5-6 line overview of the business you are in from the 30,000 foot level. It will improve communications for us all.
    Also, you should review Primary and foreign keys.
    Good luck with your project.

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

Similar Threads

  1. Replies: 1
    Last Post: 11-04-2014, 12:07 PM
  2. Creating a subform which displays values from a table
    By marcvanderpeet12 in forum Access
    Replies: 1
    Last Post: 03-03-2014, 01:04 PM
  3. Replies: 3
    Last Post: 01-21-2013, 12:57 AM
  4. Replies: 4
    Last Post: 06-18-2012, 07:01 AM
  5. Replies: 13
    Last Post: 02-26-2012, 08:28 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