You are here:

Using MS Access/Form Based Parameter Query - does not pull values



I am an advanced Access user and I am having trouble with a form based parameter query.

I have a form (frmSelectRecords) that simply has a list box (pulling "firm name" from my table) and a button. (The user can select more than one record)

I have a query (qryBalanceDifference) that is supposed to search the form for the paramters defined in the list box.

The criteria on firm name in my query reads: [Forms]![Select Records Form]![FirmName]

I have tried two different approches to the button. I have created a button from the wizard using the "Run Query" function.

I have also tried creating a button with the following code tied to the ON Click event:

Private Sub OK_Click()
 Me.Visible = False
 DoCmd.OpenQuery "qryBalance Difference", acViewNormal, acEdit
 DoCmd.Close acForm, "frmSelectRecords"
End Sub

Both of these options return the same result: The query runs and the form closes, but the query doesn not populate with the records I selected in the list box.

Any ideas/tips??? Any help would be very much appreciated! Thanks!

First you've got some naming discrepancies there. You said the form is frmSelectRecords but your code is looking at [Forms]![Select Records Form]![FirmName] which is not right.

Next, if you're using a listbox with a SINGLE RECORD, then this should work just fine, however when you start dealing with multi-select listboxes you can't just pick more than one item and expect it to work. There's a whole bunch of VBA needed to parse the values. I cover this in detail in my Access 321 tutorial. It's far too complex to go into here.


Using MS Access

All Answers

Answers by Expert:

Ask Experts


Richard Rost


I am happy to answer any kinds of questions about Microsoft Access - from basic table design to advanced VBA programming. Also, please feel free to check the Access Tips & Tricks section of my web site, and free Access 101 tutorial.


I am the president of and I specialize in Microsoft Access Tutorials. I have been teaching Access in the classroom since 1994, and online since 2002.

I am a self-taught Access expert. I have been building databases for clients since the early 90s. You can see a sample of my Access Tutorials on my web site at

©2016 All rights reserved.