Greetings,
I have looked through the discussions with this as a keyword and have not found a fix to my problem.
In general it is this. I have two tables LOOKUP and ORDERD. In lookup are some records that have apostrophes in them. In my form I allow the user to select a record from LOOKUP to add to ORDERED. This data can only be entered into ORDERED once so I check the table prior to writing the record. In the same respect, I allow the user to delete a record from ORDERED if they desire.
This works fine in all respects unless the data text includes an apostrophe. My problem manifests with the FindFirst method because I cannot get my string criteria correct. I am beginning to think this is impossible since by necessity for comparison, there has to be an odd number of single quotes at best and this trips an error in FindFirst.
The solution I found here, adds another single quote to the text but then the comparison fails.
I am beginning to think my only solution is to loop through all of the text in the ORDERED table when the text-value in the LOOKUP table has an apostrophe. For both I could change the apostrophe to something like "XXX" and then perform the comparison, and keep looping until all records are checked. Since there should be no more than 50 records with text less than 50 characters, this seems doable. I just keep thinking there is a better solution.
Any thoughts and/or suggestions will be greatly appreciated.
Regards, Sorrells
I have looked through the discussions with this as a keyword and have not found a fix to my problem.
In general it is this. I have two tables LOOKUP and ORDERD. In lookup are some records that have apostrophes in them. In my form I allow the user to select a record from LOOKUP to add to ORDERED. This data can only be entered into ORDERED once so I check the table prior to writing the record. In the same respect, I allow the user to delete a record from ORDERED if they desire.
This works fine in all respects unless the data text includes an apostrophe. My problem manifests with the FindFirst method because I cannot get my string criteria correct. I am beginning to think this is impossible since by necessity for comparison, there has to be an odd number of single quotes at best and this trips an error in FindFirst.
The solution I found here, adds another single quote to the text but then the comparison fails.
I am beginning to think my only solution is to loop through all of the text in the ORDERED table when the text-value in the LOOKUP table has an apostrophe. For both I could change the apostrophe to something like "XXX" and then perform the comparison, and keep looping until all records are checked. Since there should be no more than 50 records with text less than 50 characters, this seems doable. I just keep thinking there is a better solution.
Any thoughts and/or suggestions will be greatly appreciated.
Regards, Sorrells