Filter by form (runtime)

adamc

New member
Local time
Today, 15:41
Joined
Dec 20, 2005
Messages
8
Hi all,

I am new to all this database stuff and new to your forums so please be gentle :P

I have a database i have made, only a small project atm but filtering by form is a big part of the workings of the database. Now as i understand it the filter is not included in Access RunTime2000 is there any way to create a form to simulate the above filter ?

Thxs in advance

Adam
 
On the event of your choice:

To initiate filtering:

me!filteron = true
'for a byte/integer/long number
me!filter = "FilterFieldName=" & 8
or
me!filter = "FilterFieldName=" & me!NumericFieldName

'or for string
me!filter = "FilterFieldName=" & chr(34) & "your string" & chr(34)
or
me!filter = "FilterFieldName=" & chr(34) & me!txtfieldname & chr(34)

'or for date
me!filter = "FilterFieldName= #" & mm/yy/dd & "#"
or
me!filter = "FilterFieldName= #" & me!datefieldname & "#"


To stop filtering:

me!filteron=false
me!filter="" ' to eliminate dead criteria
 
Thank you for you'r reply much appreciated.

However i can't seem to get the code you gave me working, i made a button and put this on the ONclick function. When clicked i get can't find FilterON field. This is what i have on the Event:

Private Sub Command32411_Click()
On Error GoTo Err_Command32411_Click

Me!FilterOn = True
Me!Filter = "PNumber=" & 8
Me!FilterOn = False
Me!Filter = ""

Exit_Command32411_Click:
Exit Sub

Err_Command32411_Click:
MsgBox Err.Description
Resume Exit_Command32411_Click

End Sub

I must appologise for my lack of programming knowledge, and thank you for any more pointers. I will try to figure this out and post if i do :)

Thxs again

Adam
 
Hello again,

After a long frustrating day i come accross a link on the microsoft site, (http://support.microsoft.com/kb/262099/EN-US/) had quite a nice little example and a form creator built in.

I have no idea how this works but it did manage to get me around my problem Sort of :P just means another couple of clicks for the users but hey it's not a perfect world. So if anyone else is having similar problems then it is worth a shot.

Thxs again for your help llkhoutx

Adam
 

Users who are viewing this thread

Back
Top Bottom