DeveloperBarn Forums

Go Back   DeveloperBarn Forums > Databases > Microsoft Access

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 « Previous Thread | Next Thread »  
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old June 6th, 2008, 11:56 AM
AOG123's Avatar
Lightning Master

 
Join Date: Mar 2008
Location: Fortress Of Solitude
Posts: 77
Thanks: 6
Thanked 20 Times in 15 Posts
Rep Power: 1
AOG123 is on a distinguished road

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 (permalink)  
Old June 6th, 2008, 12:00 PM
sbenj69's Avatar
Moderator

 
Join Date: Mar 2008
Posts: 73
Thanks: 18
Thanked 20 Times in 15 Posts
Rep Power: 1
sbenj69 is on a distinguished road

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, 4 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


Sponsored Links

ASP.NET Resource Index
a directory of ASP.NET tutorials, applications, scripts, assemblies and articles for the novice to professional developer.

Free Web Directory
Including Chats and Forums Resources, Offer automatic, instant and free directory submissions.
URLZ Web Directory
URLZ Web Directory

Free Web Directory - Add Your Link
The Little Web Directory
Free Web Directory
Pegasus free web directory is a free directory organised by categories.

Web Directory & SEO Services
dirroot web directory


All times are GMT -4. The time now is 08:13 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright © 2008 DeveloperBarn.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46