Results 1 to 2 of 2
  1. #1
    Meanfish is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    3

    Form/Subform - Creates blank entry in Table - Frustrating... HELP!!

    Hi Guys and Gals,



    I'm new to Access, but making pretty good headway on a database that I am creating for a charity project. I have an issue with a form/subform I have created to do multiple sales entries.

    Form linked to Sales Table
    Subform linked to Sales/Product Query

    It works great except for 1 thing, it creates 1 black entry in the sales table when you enter the subform,

    On the MainForm I have MembershipID and Date

    In Subform, have Product, Quantity, Cost

    The Parent/Child relations are MembershipID, Date and Product.

    When you enter Membership ID and Date in the main form, its fine, but when you go to click on a product in the SubForm, a Blank Entry is generated in the sales table burning a SalesID. I can query past it, but it makes SalesID useless to me. It also generates an error message, 'You tried to enter Null value to a value that is not a variant data type' (the Product field - which is blank in the Sales Table.

    I'm assuming that I need to stop the MainForm from creating a data entry before the subform is filled out.... but how **Shrug**

    Tried to Attach DB, but it wouldn't upload it...... Please contact me and I can email it.

    Thanks Heaps

    Meanfish

  2. #2
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    Is the Main Form displaying the contents of the Sales Table and the Sub Form the contents of another Table.

    If you can't upload your Database Describe the structure that you have. e.g.

    tblSales

    SalePK as Autonumber Primary Key.
    Other Fields.

    tblSalesDetalis

    SaleDetailPK Autonumber Primary Key
    SaleFK Number Foreign Key to tblSales
    OtherFields.

    If you could explain like this it would be a good start to solving your problem.

    BTW You only need one Field to act as the Primary Key in any Table. AutoNumber is the best Data Type to use.

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

Similar Threads

  1. Table Design -- want to avoid a design that creates blank fields
    By snowboarder234 in forum Database Design
    Replies: 4
    Last Post: 10-08-2012, 10:13 AM
  2. Replies: 5
    Last Post: 08-21-2012, 12:30 PM
  3. Replies: 6
    Last Post: 01-12-2012, 09:13 AM
  4. Replies: 11
    Last Post: 11-13-2011, 06:57 PM
  5. Replies: 5
    Last Post: 10-28-2010, 09:48 PM

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