By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,488 Members | 2,552 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,488 IT Pros & Developers. It's quick & easy.

Filter values of a Listbox

P: 32
Access 2000, regarding forms.

I want a command BUTTON labeled "server" on a MAINFORM that:
> Opens up a INVENTORY form-which contains a list box- and
> Filter the values in the LIST BOX (for ex. shows only a list of server pcs and not entire inventory)

Once working I would add other buttons on MAINFORM which would open up INVENTORY form and filter based on other values.

Is this possible? let me know, Thanks
Jul 17 '07 #1
Share this Question
Share on Google+
3 Replies


P: 65
Access 2000, regarding forms.

I want a command BUTTON labeled "server" on a MAINFORM that:
> Opens up a INVENTORY form-which contains a list box- and
> Filter the values in the LIST BOX (for ex. shows only a list of server pcs and not entire inventory)

Once working I would add other buttons on MAINFORM which would open up INVENTORY form and filter based on other values.

Is this possible? let me know, Thanks

You may use:
SELECT [tblNameAge].[stname] FROM tblNameAge WHERE stAge=18;
Jul 17 '07 #2

P: 32
You may use:
SELECT [tblNameAge].[stname] FROM tblNameAge WHERE stAge=18;

Not sure where I should put that code. Here is what I have, Not using a listbox:
Private Sub SwitchorRaritan_Click()
On Error GoTo Err_SwitchorRaritan_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "deviceselectionZ"

stLinkCriteria = [Category]='switch'or [Category]='raritan' "
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_SwitchorRaritan_Click:
Exit Sub

Err_SwitchorRaritan_Click:
MsgBox Err.Description
Resume Exit_SwitchorRaritan_Click

End Sub
Jul 17 '07 #3

P: 65
Not sure where I should put that code. Here is what I have, Not using a listbox:
Private Sub SwitchorRaritan_Click()
On Error GoTo Err_SwitchorRaritan_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "deviceselectionZ"

stLinkCriteria = [Category]='switch'or [Category]='raritan' "
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_SwitchorRaritan_Click:
Exit Sub

Err_SwitchorRaritan_Click:
MsgBox Err.Description
Resume Exit_SwitchorRaritan_Click

End Sub

You have to put it in a query in the SQL view.
Jul 26 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.