Register Blogs FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Go Back   DeveloperBarn Forums > Databases > Microsoft Access

Sponsored Links

Discuss "DoCmd.ApplyFilter" in the Microsoft Access forum.

Microsoft Access - Microsoft Access is a database for small to medium applications. Learn tips and tricks and best database practices here.


Closed Thread
 
LinkBack Thread Tools Display Modes
  #1  
Old June 6th, 2008, 11:56 AM
AOG123's Avatar
Lightning Master
 
Join Date: Mar 2008
Location: Fortress Of Solitude
Posts: 111
Thanks: 10
Thanked 27 Times in 21 Posts
Rep Power: 1
AOG123 will become famous soon enough

Awards Showcase
Microsoft Access 
Total Awards: 1

Default DoCmd.ApplyFilter

Hi,..

I'm trying to add filters to a continuous form but don't want to change the undelying query,..

So i've tried using the DoCmd.ApplyFilter in the after update of a combo

Below is the closest i can get,. when i say close at least it filters the records,.. but filters them all out

The example i'm using is simply filtering a text field field,.. the combo is in the form header.

DoCmd.ApplyFilter , ("fieldname= ' " & Combo.Value & " ' ")

Any ideas,.. i guess this will be something obvious
__________________
If i helped you, make me famous by clicking the

Sponsored Links
  #2  
Old June 6th, 2008, 12:00 PM
sbenj69's Avatar
Moderator
 
Join Date: Mar 2008
Posts: 101
Thanks: 23
Thanked 30 Times in 22 Posts
Rep Power: 1
sbenj69 will become famous soon enough

Awards Showcase
Microsoft Windows Microsoft Access 
Total Awards: 2

Default

Say your combobox was me.combo18, after update, put this:
Code:
Dim mystr As String
Dim FltrStr As String

mystr = Nz(Me.Combo18, "")
FltrStr = "Fieldname ='" & mystr & "'"

DoCmd.ApplyFilter , FltrStr

Comments on this post
jmurrayhead agrees: indeed
lewy agrees:
Attached Files
File Type: zip db1.zip (11.9 KB, 10 views)

Last edited by sbenj69; June 6th, 2008 at 12:03 PM.
The Following User Says Thank You to sbenj69 For This Useful Post:
AOG123 (June 6th, 2008)
Closed Thread

  DeveloperBarn Forums > Databases > Microsoft Access

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -4. The time now is 10:17 AM.



Content Relevant URLs by vBSEO 3.2.0