Results 1 to 3 of 3
  1. #1
    axess_nab is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    May 2010
    Posts
    30

    Unhappy Problems with types dlookup function to complete info


    Hi guys I have a problem... I've been creating a database for my work for the purchase department. I'm currently designing the orders form which has a combobox in wich you can select the supplier name and automatically complete de information regarding the data of this supplier (address, phone, fax, etc.)

    I'm using a macro which acts after the combobox changes using the setvalue action in which the argument is as follows:

    [Forms]![Orden de Compra]![Direccion_OC], DLookup("Direccion","Proveedores","Nombre = '" & [Forms]![Orden de Compra]![cmb_proveedor] & "'")

    The "Direccion_OC" field is in the "Orden de Compra" form, this is where I want to put the address of the supplier which is selected with the "cmb_proveedor" combobox. The table that contains the supplier as you can see is "Proveedores" and I search with the field named "Nombre" for the field "Direccion" which contains the address.

    when I try to run the macro it appears the missmatch type error

    I've already tried checking the type of the data in the tables, both are exactly the same type.

    I'm attaching a copy of my database hoping there's someone here who can help its in spanish but I hope I've gave enough detail of the fields involved for you to understand the problem.

    Please guys help!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I haven't looked at your db, but I would use this rather than the DLookup's:

    http://www.baldyweb.com/Autofill.htm

    It would be much more efficient than several DLookup's. If you want to stay with them, the type mismatch error is usually do to syntax inappropriate for the data type:

    DLookup Usage Samples
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    axess_nab is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    May 2010
    Posts
    30
    Pbaldy thank you so much your article made me realize I really didn't needed to save this data again. I didn't tried your solution because I was able to perform the dlookup function before but only as an expression not as a macro. I still use this function because I used it on a report to use the printable version of the order. Thanks again and I'll probably keep asking you more stuff if you have a chance to check out my database for any advice I'd really appreciate it! thanks again!

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

Similar Threads

  1. using the and function in a dlookup statement
    By englisap in forum Programming
    Replies: 10
    Last Post: 01-10-2011, 09:53 PM
  2. Format in Dlookup function
    By tpcervelo in forum Forms
    Replies: 6
    Last Post: 10-22-2010, 10:23 AM
  3. dlookup function problem
    By bdaniel in forum Programming
    Replies: 3
    Last Post: 04-26-2010, 05:55 AM
  4. Replies: 3
    Last Post: 10-06-2009, 02:11 PM
  5. Need Help for Dlookup function
    By wasim_sono in forum Programming
    Replies: 5
    Last Post: 01-04-2006, 08:18 AM

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