-
access database /VB6
I am using the following code to search a table for company name and notify the client if there is no Campany name, so he can enter the company name. but I keep getting an error message. Invalid statement, expected delete insert, procedure of update. This line of code gets highlighted
rs.Open "StrSQL", ad, adOpenDynamic, adLockOptimistic, adCmdText
HERE ARE MY CODE:
StrSQL = "select T.CompanyName from TripLogTbl" & _
"where T.CampanyName IS NOT NULL"
rs.Open "StrSQL", ad, adOpenDynamic, adLockOptimistic, adCmdText
If Not rs.BOF And Not rs.EOF Then
txtCompanyName.Text = rs.Fields("CompanyName").Value
End If
-
Originally Posted by alobi
I am using the following code to search a table for company name and notify the client if there is no Campany name, so he can enter the company name. but I keep getting an error message. Invalid statement, expected delete insert, procedure of update. This line of code gets highlighted
rs.Open "StrSQL", ad, adOpenDynamic, adLockOptimistic, adCmdText
HERE ARE MY CODE:
StrSQL = "select T.CompanyName from TripLogTbl" & _
"where T.CampanyName IS NOT NULL"
rs.Open "StrSQL", ad, adOpenDynamic, adLockOptimistic, adCmdText
If Not rs.BOF And Not rs.EOF Then
txtCompanyName.Text = rs.Fields("CompanyName").Value
End If
Try this:
Code:
rs.Open StrSQL, ad, adOpenDynamic, adLockOptimistic, adCmdText
Boyd Trimmell aka HiTech Coach
Microsoft MVP - Access Expert
[SIGPIC][/SIGPIC]
Office Programming 25+ years as a Software Developer specializing in:
Business Process Management
Accounting/Inventory Control
Customer Relations Management (CRM)
Electronic Data Interchange (EDI)
-
Thanks HiTechCoach, the change took care of my problem. Problem resolved.
-
Originally Posted by alobi
Thanks HiTechCoach, the change took care of my problem. Problem resolved.
You're welcome!
Glad I could assist.
Boyd Trimmell aka HiTech Coach
Microsoft MVP - Access Expert
[SIGPIC][/SIGPIC]
Office Programming 25+ years as a Software Developer specializing in:
Business Process Management
Accounting/Inventory Control
Customer Relations Management (CRM)
Electronic Data Interchange (EDI)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|