Results 1 to 2 of 2
  1. #1
    Ant@20 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    1

    Exclamation How to get data to appear automatically from another table


    I want cost data from the other delivery table to come automatically to appear in this order table as soon as I click Pick-up or any other delivery option from the drop down box. This is necessary because if I was to only have 2 drop downs then I could click £10 accidentally for pick up which is £0 or any other similar mistakes. Please help quickly, this is urgent.

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I don't think this can be done if you are entering data directly into a table.

    Now if you were using forms, that is a different matter.
    In the delivery table, I would have three fields: "DeliveryID" (autonumber), "DeliveryOption" (Text) and "DeliveryCost" (Currency).
    The row source for the combo box would something like:
    Code:
    SELECT DeliveryID, DeliveryOption, DeliveryCost FROM DeliveryTable ORDER BY DeliveryOption
    The bound column would be 1
    the Column count would be 3
    the column widths would be 0, 1.3, 0

    There would be code in the after update event of the combo box that would push the delivery cost into the delivery cost control:
    Code:
    Sub cboDeliveryOption_Afterupdate()
        me.DeliveryCost = me.cboDeliveryOption.Column(2)  '(columns property is zero based)
    End Sub
    Or you could write a UDF to get the delivery option cost.
    In the delivery option combo box after update event, set the delivery cost control to the return value of the UDF.

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

Similar Threads

  1. Automatically update data
    By scoe in forum Programming
    Replies: 2
    Last Post: 06-04-2013, 04:24 AM
  2. Replies: 10
    Last Post: 08-09-2012, 01:07 PM
  3. Importing excel data into table automatically
    By jwalker55 in forum Import/Export Data
    Replies: 2
    Last Post: 01-10-2012, 07:56 AM
  4. Updating Table Data Automatically
    By aquarius in forum Import/Export Data
    Replies: 6
    Last Post: 09-16-2010, 03:07 PM
  5. How do I enter data automatically?
    By ffurqana in forum Access
    Replies: 0
    Last Post: 07-08-2010, 07:47 PM

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