Alpha Video Training
Results 1 to 17 of 17

Thread: Help - "cannot create lookup"

  1. #1
    Member
    Real Name
    Carol Bauer
    Join Date
    Apr 2000
    Posts
    199

    Default Help - "cannot create lookup"

    I recently upgraded to v.9 (from v.4.5). I have 2 databases which are similar except for 1 has last_name, first_name (called Individuals) and the other just has company (which is called Dealers). I changed the looks of a lot of my forms first on the Individuals database, then copied the entire database for Dealers, deleted all the records, and imported all the data from my 4.5 database.

    On my Invoice form, when I tab to the "Customer ID" in my Dealer database, a window should pop up and I select my dealer (which works fine in my "Individual" database.

    I get an error message:

    Cannot create lookup.
    Lookup definition incomplete or invalid.

    No such field.

    I'm not sure where to find and correct this error. I'm sure it's somewhere where it's still looking for last_name, but can't find it.

    Any suggestions where to look to correct it?

    Thanks.

    CB

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Help - "cannot create lookup"

    Check the field rules for the parent table upon which the Invoice form is based. Specifically whatever field in that table is represented by the "Customer ID" field object on the Invoice form.
    There can be only one.

  3. #3
    Member
    Real Name
    Carol Bauer
    Join Date
    Apr 2000
    Posts
    199

    Default Re: Help - "cannot create lookup"

    I am attaching a screen shot. I can't see anything wrong in my parent table (customer).

    I don't know where else to look for the error.

    CB

  4. #4
    "Certified" Alphaholic
    Real Name
    Gaby Hernandez
    Join Date
    Sep 2008
    Posts
    1,170

    Default Re: Help - "cannot create lookup"

    Carol:
    It seems to me that you are trying to plant in CustomerID field in Customers table the cutomerID itself. You should set up CustomerID field in Invoices table as LU.
    So: delete the LU field rule that you created in Customers table for CustomerID and go to Invoices table and set up customer ID there as LU.
    Usually CustomerID in Customers table is an autoincrement and should not be accessible to the user.
    The very first box tells you that you are in Customers table not in Invoices table

  5. #5
    Member
    Real Name
    Carol Bauer
    Join Date
    Apr 2000
    Posts
    199

    Default Re: Help - "cannot create lookup"

    I tried that and I'm still getting the same error message.

    Carol

  6. #6
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,310

    Default Re: Help - "cannot create lookup"

    Post a sample of the database, with dummy data, so we can inspect it.

    Your Customer_id field is not an autoincrement field is it?

  7. #7
    Member
    Real Name
    Carol Bauer
    Join Date
    Apr 2000
    Posts
    199

    Default Re: Help - "cannot create lookup"

    I've attached it.

    Carol

    Quote Originally Posted by Tom Cone Jr View Post
    Post a sample of the database, with dummy data, so we can inspect it.

    Your Customer_id field is not an autoincrement field is it?

  8. #8
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,310

    Default Re: Help - "cannot create lookup"

    Carol, your table lookup field rule in the Invoice_header table uses an invalid "ordering" expression. The lookup list cannot be displayed in the order you have specified because the fields you specify don't exist in the lookup table (Customer).

    Also, it's not necessary to link the lookup table into the set in order to use a table lookup field rule, so you may find it advisable to remove the Customer table from your Invoice set... or at least change its link to a one-to-one. A one-to-many doesn't seem to fit the typical requirement, since presumably an invoice will be linked only to one customer.

  9. #9
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Help - "cannot create lookup"

    Carol,

    In the sample you attached the lookup field rule still specifies the first and lastname fields. Also there are three event code snippets which restrict enters and edits on the Invoice form. Rather difficult to create an invoice under those constraints.
    There can be only one.

  10. #10
    Member
    Real Name
    Carol Bauer
    Join Date
    Apr 2000
    Posts
    199

    Default Re: Help - "cannot create lookup"

    how do I view and correct the "code snippets"




    Quote Originally Posted by Stan Mathews View Post
    Carol,

    In the sample you attached the lookup field rule still specifies the first and lastname fields. Also there are three event code snippets which restrict enters and edits on the Invoice form. Rather difficult to create an invoice under those constraints.

  11. #11
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Help - "cannot create lookup"

    With the form in design mode, right click on the background, choose Events, select the oninit, onfetch, and onsave - one at a time. Hilight the code and delete it. Save, close, and do another.

    Unless you have some reason the have the code there.
    There can be only one.

  12. #12
    Member
    Real Name
    Carol Bauer
    Join Date
    Apr 2000
    Posts
    199

    Default Re: Help - "cannot create lookup"

    okay - each of those (OnFetch, OnInIt, OnSave) only have this in:

    ''XBasic
    this.restrict_change=.t.
    this.restrict_enter=.t.

    OnKey has this:

    ''XBasic
    if this.mode_get()="VIEW" then
    if a_user.key.event="down" then
    select
    case upper(a_user.key.value)="C"
    this.restrict_change=.f.
    a_user.key.handled=.t.
    cust_balance.activate()
    cust_id.activate()
    case upper(a_user.key.value)="E"
    this.restrict_enter=.f.
    a_user.key.handled=.t.
    this.new_record()
    end select
    end if
    end if


    I also went into the customers.dbf and corrected the "last_name" & "first_name" stuff - (corrected image below)

    I'm still getting the error messages that refers to Last_name & first_name.

    This is too tough for me to try to figure out. I'll go back to using my older version of Alpha for this database.

    Everything worked fine for the other database I had. The only difference was that this one has "Company" instead of Last_name & First_name.

    Carol



    Quote Originally Posted by Stan Mathews View Post
    Carol,

    In the sample you attached the lookup field rule still specifies the first and lastname fields. Also there are three event code snippets which restrict enters and edits on the Invoice form. Rather difficult to create an invoice under those constraints.

  13. #13
    Member
    Real Name
    Carol Bauer
    Join Date
    Apr 2000
    Posts
    199

    Default Re: Help - "cannot create lookup"

    oops - forgot to attach image

  14. #14
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Help - "cannot create lookup"

    Carol,

    The screenshot I attached earlier had to do with the invoice_header table - not - the customer table. I think Tom pointed out earlier, you seem to be trying to lookup customer information from present customers. The point of the lookup is to avoid having to fill in all the fields on the invoice_header when the information already exists in the customer table. You don't need/want a customer_id lookup in the customer table. You loookup information for the invoice from the customer table.

    If you define the customer_id lookup as you have, how can you enter new customers?

    Whichever form you were working with when you removed the code (customer/invoice_header) the other has the same code.
    There can be only one.

  15. #15
    Member
    Real Name
    Carol Bauer
    Join Date
    Apr 2000
    Posts
    199

    Default Re: Help - "cannot create lookup"

    I changed the "lookup" in the customer database to no lookup and went into the invoice-header table and did the lookup there.

    Still getting the same error message.

    I guess I just don't get it. I'm ready to just give up. I've spent all day trying to get it to work.

    I had all this the same in my Individual database, like I said and everything worked (I had the lookup in the customer table there). The only thing different between the 2 databases was the Individuals had last_name & first_name fields, and the dealer database did not.


    Carol



    Quote Originally Posted by Stan Mathews View Post
    Carol,

    The screenshot I attached earlier had to do with the invoice_header table - not - the customer table. I think Tom pointed out earlier, you seem to be trying to lookup customer information from present customers. The point of the lookup is to avoid having to fill in all the fields on the invoice_header when the information already exists in the customer table. You don't need/want a customer_id lookup in the customer table. You loookup information for the invoice from the customer table.

    If you define the customer_id lookup as you have, how can you enter new customers?

    Whichever form you were working with when you removed the code (customer/invoice_header) the other has the same code.

  16. #16
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Help - "cannot create lookup"

    Ok, try downloading my file, unzipping to a new location, and see how it performs.
    There can be only one.

  17. #17
    Member
    Real Name
    Carol Bauer
    Join Date
    Apr 2000
    Posts
    199

    Default Re: Help - "cannot create lookup"

    I did finally get it working (my original copy).

    I did download yours and that didn't work.

    What a mess!

    Thanks for trying to help me out. I DO appreciate it!

    Carol

    Quote Originally Posted by Stan Mathews View Post
    Ok, try downloading my file, unzipping to a new location, and see how it performs.

Similar Threads

  1. "Add" and "Save" buttons don't stay on "Self" page
    By Scholin in forum Application Server Version 8
    Replies: 2
    Last Post: 02-05-2008, 08:50 AM
  2. Field rule lookup - select "A"; enter "X"
    By CALocklin in forum Alpha Five Version 8
    Replies: 5
    Last Post: 01-24-2008, 04:45 PM
  3. Bug in V8? Create link in set, "child table in use" error
    By kthibeault1965 in forum Alpha Five Version 8
    Replies: 2
    Last Post: 10-02-2007, 10:13 PM
  4. Replies: 0
    Last Post: 12-11-2006, 08:50 AM

Bookmarks

Posting Permissions

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