Results 1 to 2 of 2
  1. #1
    nkenney is offline Advanced Beginner
    Windows 2K Access 2007
    Join Date
    Mar 2009
    Posts
    40

    Question Populating other fields from combo box.

    I have a combo box that contains a drop down of customer id’s. When a user selects a customer ID, I want to use that get the city and put it in a text box. I have the following code on the after update code on the customer ID field:

    Private Sub Custid_AfterUpdate()


    City = DLookup("[City ]", "Customer", "[CustID ] = '" & Me!Custid& "'")
    End Sub

    I get the data type mismatch in criteria expression error. I did check and &Me!Custid is displaying the correct value.
    Any ideas as to what I am doing wrong?

    Thanks!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Your CustID is probably numeric so no quotes are required.
    City = DLookup("[City ]", "Customer", "[CustID ] = " & Me!Custid )

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

Similar Threads

  1. Multiple Fields In One Combo Box.
    By caljohn527 in forum Forms
    Replies: 1
    Last Post: 02-20-2009, 03:07 PM
  2. Combo box select from two fields
    By cnestg8r in forum Access
    Replies: 0
    Last Post: 10-31-2008, 10:05 AM
  3. Replies: 0
    Last Post: 08-17-2008, 12:19 PM
  4. Populating Data in forms
    By cjbeck71081 in forum Forms
    Replies: 4
    Last Post: 01-16-2007, 04:15 PM
  5. Calculated Text Box Populating in Table
    By Debbie in forum Access
    Replies: 2
    Last Post: 11-13-2006, 08:02 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