List box help

G

Guest

I use several cmdbuttons to open the same form frmCust to display records. I
open the form with the following:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmCust"
stLinkCriteria = "[StatusID] = 1"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Each cmdbutton has the stLinkCriteria = "[StatusID] = "?"" changed.
"?" = 1 for Active, 2 for Inactive, 3 for Deceased, etc.

Once the form is open I use a list box to go to specific records. The
problem is the list box is based on the original form and query and reads:

SELECT [qryCust].[Full name] FROM [qryCust];

How can I limit the list box to only display the records in the current
recordset of the form?

Thanks!
 
K

Ken Snell \(MVP\)

See my reply to your post in the modulesdaovba newsgroup where you posted
this same question.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top