Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2002
    Posts
    20

    Unanswered: Autolookup Problems

    Right boys and girls this is my problem !!

    I have a form setup and what i am trying to do for users, is when they add a new entry they have the option to select or type a product code from the list, this will then generate at the same time the name of the product in the Product name field only, and all other fields will be blank and have to be typed manually.

    Now i know its to do with AutoLookup combo boxes but i can't seem to get it to work

    Any ideas

  2. #2
    Join Date
    Feb 2002
    Posts
    403

    Re: Autolookup Problems

    Originally posted by Admaski123
    Right boys and girls this is my problem !!

    I have a form setup and what i am trying to do for users, is when they add a new entry they have the option to select or type a product code from the list, this will then generate at the same time the name of the product in the Product name field only, and all other fields will be blank and have to be typed manually.

    Now i know its to do with AutoLookup combo boxes but i can't seem to get it to work

    Any ideas
    There are a few ways to make this work. The simplest for what you are describing is probably to do teh following:

    Set up your combo box to three columns the columns are ProductID, ProductCode and ProductDescription or whatever you have called them.

    Make column widths as follows 0;2.5;0 (in metric)

    In teh after update event of the combo box tell the other field where to get it's data in code this looks like:

    Me.txtProductName=Me.cboProductNumber.Column(2)

    This will pull the data from the third column in teh combo box into the text box named txtProductName

    HTH

  3. #3
    Join Date
    Jul 2002
    Posts
    20
    I can’t get it too work

    This is what I am doing

    I create a Combo Box through wizard and want the Combo Box to to look up values in my query and table. I then select Product ID, Product Code, Product Name from the Supplier Table.
    Then it asks me to uniquely identify a row which I select Product Code. It then asks me where I want to store the value and I select the Product Code.

    Then I go to After Update Field, select the code builder and enter the following:
    Private Sub Product_Code_GotFocus()
    Me![Product Name].Text = Me![Product Code].ColumnCount(2)
    End Sub

    But it doesn’t work and comes up with a Runtime error 451??

    What am I doing wrong and is there any other ways of doing it

    Thanks

  4. #4
    Join Date
    Feb 2002
    Posts
    403
    Private Sub Product_Code_GotFocus()
    Me![Product Name] = Me![Product Code].Column(2)
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •