This has been working fine for years but a few months back, I intermittently get these three popups for each lookup (I click on OK or Cancel on each popup and the data is still retrieved from the database):How do I stop these popups? Thanks.
Microsoft AccessMicrosoft WordMicrosoft OfficeMicrosoft ApplicationsVisual Basic Classic
The database is open in MS Access. Sometimes I can stop the popups in subsequent calls by closing then reopening MS Access.
BTW: the "WIth" on line 3 of the code was included here in error. It is not in the actual code.
PatHartman
Put a stop in the code so you can print out the contents of strSQL. Post the generated string if you don't see the issue.
thenelson
ASKER
here is a sample strSQL:
SELECT DISTINCT * FROM Contacts WHERE (([Contacts].[FirstName] & " " & [Contacts].[LastName])="Sandra Smith") OR ((Contacts.CompanyName)="Sandra Smith")
That can't be the actual contents of strSQL. Please put a stop in the code and paste the contents after strSQL has been populated.
thenelson
ASKER
This is an actual sample of the contents of strSQL that works at getting the correct results from the Contacts table in the database. I copied it after a code stop after the line:
strSQL = "SELECT DISTINCT * FROM Contacts WHERE (([Contacts].[FirstName] & "" "" & [Contacts].[LastName])=""" & strName & """) OR ((Contacts.CompanyName)=""" & strName & """)"
PatHartman
The concatenation should have been resolved. We should not be seeing it in the string.
strName is not in strSQL when it is sent to Access.
Here is strSQL as sent to Access again:
SELECT DISTINCT * FROM Contacts WHERE (([Contacts].[FirstName] & " " & [Contacts].[LastName])="Sandra Smith") OR ((Contacts.CompanyName)="Sandra Smith")
I don't think that article applies here. I have the latest edition of the Jet Service Pack; I am not getting the error mentioned in the article and as you see, I have no joins in the query.
BTW: the "WIth" on line 3 of the code was included here in error. It is not in the actual code.