I have run into a problem using a text string as the key value while doing either lookup( or superlookup(. The same arrangement of text works as it should when it is used in a Find/Select from the data sheet. The equality or inequality tests that I have run in code also give the correct results. I will not be surprised if this is due to something that I have missed, and I am curious as to what it might be. In the meantime, I will just apply stripchar( to condense the text to a simpler form.
This turned up as I continue to flatten out an old database application that consists of many separate single purpose databases. There are different types of data used as key values between some of the different pairs of databases. The key values that are giving me problems now are file numbers that identify different case histories. These numbers are typically in the form of 0-0-00, with an occasional letter before or after the numeric part of the file number, such as W1-0-45a. Once I modify the text format of the key values and get the lookup function to work with these file names, I will use the lookup statements in a procedure to move the data in the database that is being searched into the main database, thus eliminating one more ancillary database.
This is an example of a lookup that does work with the main database and another database that contains names and addresses. In this case, the key values are integers.
LN = superlookup(“Clients”, |||Key = ««TableKey»»|||, |||LastName|||)
A lookup of the same construction, but using integers with hyphens, as text, does not work for me, giving me the error “superlookup( function failed to match.” If I remove the non-numeric characters (0-0-05 becomes 0005), this statement runs without error.
R = superlookup(“Different Database”, |||FileNumber = ««FileNum»»|||, |||”Data to retrieve, in date format”|||)
I would like to know if this is a known problem. If it is not, I would welcome any information about how to resolve this without the added step of first modifying the key value text format.
Thank you, Ken