|
-
Jul 18th, 2000, 10:32 AM
#1
Thread Starter
Lively Member
Is there anyway to make an access query look at a Modules for the parameter that you want to pass to it.
If so how do you have to set the query up.
VB 6 Professional Edition
-
Jul 18th, 2000, 10:34 AM
#2
Addicted Member
if I remeber correctly ... you have to use functions declared as PUBLIC only... it's possible also that the returned value has to be variant (not sure about that last one thought)
hope it helps
-
Jul 18th, 2000, 12:52 PM
#3
Thread Starter
Lively Member
and i write the functions in the module, but how does the query know to get them
VB 6 Professional Edition
-
Jul 18th, 2000, 01:11 PM
#4
Monday Morning Lunatic
Create the query from a VB function, using SQL, then shove it into the query and execute.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jul 18th, 2000, 01:16 PM
#5
Addicted Member
Are you doing this in MS-ACCESS or are you accessing an ACCESS database via vb??
IN MS-ACCESS:
If you use the design view to create your queries then you just have to name the function in the criteria section under the right column.
If you are not sure, try using the expression buider. in the criteria section, right click and select "BUILD..." and then go to FUNCTIONS. There you have 2 choices: BUILT-IN and the other one has the name of your database. choose that last one and you should see your function in the list on the right.
VIA VB:
Just concatenate (hope I speled it right, I speak french ) your function in your query defenition.
Example
SomeRecordSet = Database.OpenRecordset ("SELECT * FROM UserTable WHERE User_Name = '" & GetUserName & "'")
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
|