|
-
Jul 24th, 2006, 11:09 AM
#1
Thread Starter
New Member
Help with class module
I am rather new to the programming arena, so please excuse the elementary nature of my question(s). In the query below, the class module returns the required fields for a specific item. The ultimate goal for this query is to return any records from the items that have a null value in a required field.
rsfields.Open "SELECT * FROM " & lvItem _
& " WHERE IsNull (" & cla1.GetORISFieldsList(lvItem.Text) & ")", _
cnWS, adOpenStatic, adLockReadOnly
I know the class module is working properly, but I think my ordering may be incorrect. I am getting the following error message: "Wrong number of arguments used with function in query expression...)
Any tips and/or suggestions would be greatly appreciated.
-
Jul 25th, 2006, 01:52 AM
#2
Re: Help with class module
Welcome to the Forum 
IsNUll in SQL expects two arguments. And in this senario I think you should be checking whether the field is Null or Not and IsNull is not the one to use. Your Query should be like this
VB Code:
rsfields.Open "SELECT * FROM " & lvItem _
& " WHERE " & cla1.GetORISFieldsList(lvItem.Text) & " Is Null", _
cnWS, adOpenStatic, adLockReadOnly
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Jul 25th, 2006, 02:07 PM
#3
Thread Starter
New Member
Re: Help with class module
Thanks for the tip. However, this query results with a message box saying there is a syntax error (comma) in the query expression.
-
Jul 26th, 2006, 03:53 AM
#4
Re: Help with class module
Put a break point at rsFields.Open statement and before executing print the SQL Query in the immediate window. Then analyze the query and see what is wrong.
What is the present in these two
lvItem
cla1.GetORISFieldsList(lvItem.Text)
Use [code] source code here[/code] tags when you post source code.
My Articles
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
|
Click Here to Expand Forum to Full Width
|