Using a combo box to filter datasheet in split form (1 Viewer)

sashapixie

Registered User.
Local time
Today, 18:57
Joined
Sep 30, 2015
Messages
27
Hi There

I have a form with a combo box in split form which I want to use to filter the results in my datasheet at the bottom of my split form.

I have the following code but when I make a selection it filters to a new record???

Private Sub CmbEmployeeSelector_AfterUpdate()
Me.Filter = Me.Full_Name = Me.CmbEmployeeSelector
Me.FilterOn = True
End Sub


I also would like to know how can I take the filter off if the combo box is blank.

Any help would be appreciated.
 

Cronk

Registered User.
Local time
Tomorrow, 03:57
Joined
Jul 4, 2013
Messages
2,774
The filter syntax would be like

Me.Filter ="Full_Name = " & Me.CmbEmployeeSelector

but if this is a string field it would have be included in quotes
Me.Filter ="Full_Name = '" & Me.CmbEmployeeSelector & "'"

Take the filter off?
Filteron = false
 

sashapixie

Registered User.
Local time
Today, 18:57
Joined
Sep 30, 2015
Messages
27
Hi Cronk

The fileron = false is great, thank you, however when I use the code for the string field I get a enter parameter value pop up to enter full name

Should I need to reference the field in the form as in Forms![Training Records Menu]![Full Name]
 

Users who are viewing this thread

Top Bottom