CmdButton to open form and Filter

D

d9pierce

Hi all,
I have an unbound form called StartUp. this form only has cmdButtons
on it to open forms.

I need to create Cmd buttons to open a certain form and filter it to
meet criteria. An example of this is:

Private Sub CmdRetailClients_Click()
On Error GoTo Err_CmdRetailClients_Click

Dim stDocName As String
Dim LinkCriteria As String
stDocName = "Company_Main"
DoCmd.OpenForm stDocName, , , stLincCriteria

Exit_CmdRetailClients_Click:
Exit Sub

Err_CmdRetailClients_Click:
MsgBox Err.Description
Resume Exit_CmdRetailClients_Click

End Sub

this works fine to open the form but I need to add a filter or
something to fill a CboBox "CompanyType" with Criteria like
"Subcontractor" & "Retail Client".. which is text in this Cbo. I need
to create a different CmdButton for each record in this CboBox. I have
tried many variations but cant get it. any ideas would help.

Thanks so much,
dave
 

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