ApplyFilter

G

Gina Liddle

In my form I want to pick a value from a ComboBox and use the value to
filter the "PL" field in that form. It all sound easy but obviously not for
me! I've
tried using the below code but to no avail, help would be appreciated.

PLName = cboPLFilter.Value
DoCmd.GoToControl "PL"
DoCmd.ApplyFilter , "PL = PLName"
 
V

Van T. Dinh

If "PL" is the name of a Text Field in the Form's
RecordSource, you only need:

DoCmd.applyFilter , "[PL] = " & Chr$(34) & _
Me.cboPLFilter & Chr$(34)

HTH
Van T. Dinh
MVP (Access)
 

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