Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2010
    Posts
    25

    DLookup on the right path?

    So I am working on increases efficiency in my database and one of the most requested items was 'autofill'.
    I have a form based on a query autofill.
    The query is made up of three tables.
    Tbl Carrier which includes CarrierID, Carrier, CarrierNum, Address, City, State, Zip, Country
    PK CarrierID



    Tbl CAP which includes CAPID, Receive, DateScan, Revocation, Mailed, Note, Status, Comments
    PK CAPID
    Seconday key CarrierID

    Tbl EXP which includes EXPID, ActionDate, Receive, Accept
    PK EXPID
    Secondary key CarrierID

    Basically I have a form with all of this information in one place. My users would like to beable to type in the CarrierNum and have the rest of the fields auto fill with all the carrier data and if the number is not on file to create a new record.

    For the autofill I am under the impression that I would need DLookup? The form is bound to the query and then I would unbound the CarrierNum? I made the query and unbound the CarrierNum based on what I read online. Don't really understand the DLookUp yet but going to pick up a VBA book online because online reading has not helped much.

    Just wanted to make sure I am looking in the right direction before I invest the time.

  2. #2
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    its one way. may be the right way - but not necessarily the only way.

    let me describe a very simple and very common autofill situation: client info

    so it is a new order - and the invoice needs to have all the client address/contact info and you have repeat customers all the time - and so there is a customer table already.....

    so you have an invoice form/screen - and in the header you have a combo box that is a customer table lookup. In the body of the screen you have fields bound to an invoice table.

    You can set up that combobbox to include all the customer info (even though what displays is only their name). After you select a value in the combo box - in the afterupdate event you can 'push' all the values onto the form i.e.
    me.InvoiceCustName=me.combobox.column(2)
    me.InvoiceCustAddress=me.combobox.column(3)
    etc.

    Now a database designer cringes at the thought/concept of repeating duplicate info in multiple tables - so generally we only auto fill for display/print purposes only - into unbound textboxes and do not actually write all that info into a different table. we only write the unique cross reference customer ID value into that other table.

    Hope this helps.

  3. #3
    Join Date
    Jul 2010
    Posts
    25
    I think I remember seeing someone give that tip when I was searching on the internet. I will give it a try. I was originally intending to use it for data entry but since that is not recommended I may avoid using it. I will let you know how it goes, thanks!

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

Similar Threads

  1. back end path
    By Mclaren in forum Programming
    Replies: 1
    Last Post: 06-08-2011, 01:13 PM
  2. not a valid path
    By JJJ in forum Access
    Replies: 0
    Last Post: 03-28-2011, 10:50 AM
  3. Find UNC path
    By jordanturner in forum Access
    Replies: 2
    Last Post: 09-17-2010, 09:18 AM
  4. Not a valid path
    By hhuuhn in forum Access
    Replies: 2
    Last Post: 08-23-2010, 02:06 PM
  5. parametrize file path
    By ysrini in forum Access
    Replies: 3
    Last Post: 03-01-2010, 09:37 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