Adding data from a text box to a table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xeLcapytan983x
    New Member
    • Sep 2013
    • 4

    Adding data from a text box to a table

    Hello,

    I have a text box with a dlookup function in it. I am having trouble trying to get the information in the textbox to the table.

    The table is called Password_Reset_ Data the field I am trying to insert the data to is "Classification _Type"

    The text box's information is:
    Name: Classification_ Type
    Control Source:
    Code:
     =DLookUp("Classification_Type","Ticket_Classifications","Classification_Id=" & [Forms]![Password Reset Intake Form]![Classification_Id])
    Is this something where i can set an event in the "After Update" Area within the property sheet?

    Thanks
    Last edited by zmbd; Dec 12 '13, 02:12 PM. Reason: [Z{Please use the [CODE/] button to format posted code/html/sql/formated text - Please read the FAQ}]
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    Out of curiosity, May I ask why?
    You have the data stored once, why store it a 2nd time?
    Duplication of data isn't normally something one does unless required for auditing or some historical reason such as when a variable discount is given and the current value needs to be stored against the recordset.

    Comment

    • xeLcapytan983x
      New Member
      • Sep 2013
      • 4

      #3
      It is a pseudo ticketing system, as customers call in a ticket is logged with the number in a separate table, and that table gets exported to a auditing/metrics team.

      the table needs to read like this:
      ticket_id,custo mer_id,customer _name,secretari at,dept_id,clas sification_id,c lassification_t ype,0

      I have a list of the ticket classifications ( [table].[Ticket_Classifi cations] ) in one table and that feeds the dlookup and combo boxes in a form that the Customer service personnel use and applies the entered data to the "Password_Reset " table.

      The dlookup formula made the textbox, that was bound to the "Password_Reset " table, unbound. I'm trying to have the data that is the result of the dlookup to fill the corresponding cell for the record that is being worked on.

      Comment

      • zmbd
        Recognized Expert Moderator Expert
        • Mar 2012
        • 5501

        #4
        You can do the table export via a query; however, it sounds like there's more to this than "first meets the eye."

        Lets' see if we can make this better... sounds like you need a bound ComboBox control here - for short CBO.

        Wherein Lookup fields at the table level are frowned upon almost universially, in a normalized database, we need the equivalent at the form level (and often at the query level)... and the CBO is our friend!

        CBO have two properties:
        Control Source
        Row Source

        - In a bound form the Control Source would be bound to one of the recordset's fields

        - The Row Source can be a list (for simple stuff), a query (either stored or embeded), or a table.

        I have a form that shows an example of this here:


        KEEP IN MIND! That this DB was made in answer to BytesThread9438 79. It is only provided here so that you can see what I am talking about for the BOUND-CBO used in the form.

        If you open the database, place the main form (it should open when you open the database) in design view.
        In the details section, you'll see the CBO that are bound to the underlying recordset of the form.

        Right click on the first CBO(actually any) in the details section and show the properties. Each CBO has an Embeded Select Query, You could just as easily taken the query and saved it as one of the stored queries and referenced the stored query or indeed one of the tables.
        These provide a nice human readable text while setting the numeric value of the primary key from the related table.

        So you should be able to do the same thing with your database.

        Feel free to look at the remaining stuff in this database; however, most of it will not apply to your question.

        Comment

        Working...