G
Guest
We use several cmdbuttons to open the same form frmCust to display records.
We 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 we use a list box to go to specific records. The
problem is the list box is based on the original form and reads:
SELECT [qryCust].[Full name] FROM [qryCust];
How can we limit the list box to only display the records in the current
recordset of the form using VBA?
Thanks!
We 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 we use a list box to go to specific records. The
problem is the list box is based on the original form and reads:
SELECT [qryCust].[Full name] FROM [qryCust];
How can we limit the list box to only display the records in the current
recordset of the form using VBA?
Thanks!