chrisrigoni
Registered User.
- Local time
- Today, 14:45
- Joined
- Dec 11, 2009
- Messages
- 13
Hey, I am a novice with coding for Access 2007. I am trying to filter a form using Me.filter. Here is the code I'm using.
There are two problems. I want to be able to just type in any part of the name and bring up all profiles that contain that part. That way I can just type last name and bring up all profiles with that last name. Also, the DptCd is a numeric value and I am getting a "Data type mismatch in criteria" error when I try to filter using it. I have a textbox set up for input and three buttons: Filter Name, Filter DptCd, and Unfilter. Thank everyone for their help!
Code:
Option Compare Database
Private Sub Command34_Click()
Me.Filter = "*" & [Name] = "*" & Me.Text32
Me.FilterOn = True
Me.Requery
End Sub
Private Sub Command35_Click()
Me.FilterOn = False
Me.Requery
End Sub
Private Sub Command36_Click()
Me.Filter = "DptCd =" & Me.Text32
Me.FilterOn = True
Me.Requery
End Sub
There are two problems. I want to be able to just type in any part of the name and bring up all profiles that contain that part. That way I can just type last name and bring up all profiles with that last name. Also, the DptCd is a numeric value and I am getting a "Data type mismatch in criteria" error when I try to filter using it. I have a textbox set up for input and three buttons: Filter Name, Filter DptCd, and Unfilter. Thank everyone for their help!