Results 1 to 5 of 5

Thread: Access Module

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Posts
    72
    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

  2. #2
    Addicted Member
    Join Date
    Oct 1999
    Location
    Brossard, Québec, Canada
    Posts
    241
    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

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Posts
    72
    and i write the functions in the module, but how does the query know to get them
    VB 6 Professional Edition

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  5. #5
    Addicted Member
    Join Date
    Oct 1999
    Location
    Brossard, Québec, Canada
    Posts
    241
    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
  •  



Click Here to Expand Forum to Full Width