Results 1 to 2 of 2
  1. #1
    PatrickCairns is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Dec 2012
    Posts
    8

    passing parameters to a query


    Hi All,

    Having an issue here passing a variable to a query. To lay it out, on a form there are 2 listboxes. When first is clicked it should pass the value to the query to populate the second

    First listbox

    Code:
    Private Sub lbParts_BeforeUpdate(Cancel As Integer)
    
    
    Parameterpass = lbParts.Value
    Passedvar 'Run the GetPartFunction
    
    
    lbLocs.RowSource = qry_PartsInv
    Me.lbLocs.Requery
    
    
    End Sub
    Global Module

    Code:
    Public Parameterpass As Integer
    
    
    Public Function Passedvar() As Integer
    Passedvar = Parameterpass
    End Function
    and finally the query's criteria is set to the Passedvar().

    I can see that the Passedvar is correct and when I open the query after the function is run the query is correct, but the second listbox is not populating. Any ideas?

  2. #2
    PatrickCairns is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Dec 2012
    Posts
    8
    ARRGGGG. Quotes is the answer. Quotes Dammit! """""""""""

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Passing parameters into vb using access query
    By markyboy171 in forum Programming
    Replies: 4
    Last Post: 06-15-2012, 05:46 AM
  2. Replies: 37
    Last Post: 09-15-2011, 11:57 AM
  3. Passing parameters from a form
    By rfs in forum Forms
    Replies: 1
    Last Post: 03-15-2011, 12:25 AM
  4. Passing parameters to a query
    By stephenaa5 in forum Queries
    Replies: 3
    Last Post: 09-10-2010, 05:32 PM
  5. Passing parameters to a report
    By elmousa68 in forum Access
    Replies: 0
    Last Post: 12-07-2006, 01:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums