How create record in unbound table

Posted on 2011-10-19
Last Modified: 2013-11-05
I have a form that has these fields:

cboPartN (text field)
txtJobN (text field)
txtQty (number field)
txtType (text field)
txtDateEntered (date field)
cboToWH (text field)

When a record has been written to the bound table (records source) of the form I want a new record to be written to an unbound table.  The name of this unbound table is “tblFGTranx”.  The mapping of the information should be:
cboPartN (text field) > tblFGTranx.PartN
txtJobN (text field) > tblFGTranx.JobN
txtQty (number field) > tblFGTranx.Qty
txtType (text field) > tblFGTranx.Type
txtDateEntered (date field) > tblFGTranx.DateEntered
cboToWH (text field) > tblFGTranx.toWH

There is one catch however.  When the Qty field is written I need it to be a negative entry.

What would the code for handling this be and where do you suggest it be handled at?  Maybe on a save record command button event of the form?

Question by:SteveL13
    LVL 9

    Accepted Solution

    insert into tblFGTranx values (cboPartN, txtJobN, -1 (for txtQty), txtType, txtDate, cboToWHH);

    Yes, on the "save record" command button's event.

    LVL 119

    Assisted Solution

    by:Rey Obrero
    you have to run an insert query or use recordsets,  

    which would you prefer?

    this will add new record to the table  "tblFGTranx"

    with currentdb.openrecordset("tblFGTranx")
          !Qty= me.txtQty * -1
    end with


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    In the previous article, Using a Critera Form to Filter Records (, the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
    Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now