473,383 Members | 1,725 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

apply filter, runtime error 2488

Kaosu
19
I am trying to create an advance filter page for the program im writing and came to a problem with the applyfilter command.

what im trying to do is apply a filter to a 2nd form after you have filled out a set of requirements on the 1st.

If TOT = "GBW" Then
DoCmd.OpenForm "PlantFm"
DoCmd.ApplyFilter , "Grabexp <= date()+30" <<<<
DoCmd.Close acForm, "AdvPlantFilterFm"
End If


TOT and GBW are part of the requirement results and dont really matter to my query
Oct 26 '07 #1
4 5591
Kaosu
19
got it working now, but still need help with the next stage i cant get too work =(

Expand|Select|Wrap|Line Numbers
  1.  DoCmd.ApplyFilter , "CSCSexp <= date()+pd" 
after i got it to work with date()+30 i tried to replace that with the veriable PB which has a number stored from the filter. all seem fine apart from the +pd part
Oct 26 '07 #2
Ok I really don't understand what you are doing but here is a guess. Its probably wrong but here goes. If date +30 is giving you acceptable answers could your variable be other than an integer or a long integer? I don't think access likes adding dates when comparing dates and doubles.

My other guess is that you should specify your varible is a date by
dateadd("d", variable, date())
"d" for days, date for today, variable is of course your variable.

That said I know I'm just guessing on your process. dateadd and datediff fixes alot of problems with adding and subtracting dates in access.

Carl
Oct 26 '07 #3
nico5038
3,080 Expert 2GB
You'll need what we call "variable substitution".
Try:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.ApplyFilter , "CSCSexp <= date() + " & pd
  2.  
This will cause the string to be padded by the value of the variable pd

Getting the idea ?

Nic;o)
Oct 27 '07 #4
Kaosu
19
no problems with that so far, thx nic
Oct 29 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Luurs | last post by:
Hi All, I've been using a asp-label in the HTML <headsection for quite some time in order to dynamically generate meta-keywords,-description, css and js references. Though the actual...
1
by: mattscho | last post by:
Re: Filter By From, Apply Filter, Remove Filter Buttons in a Form. -------------------------------------------------------------------------------- Hi All, Trying to create a set of 3 buttons in...
2
by: Nhoung Ar | last post by:
Can anybody out there help me please on apply filter in MS Access. I have a form that create from the query, which contain field chidid (text field), in the form footer, I add the button to open...
1
by: ktuers | last post by:
I am trying to requery a combo box on the after update and I am getting a run-time erro '2488': You can't use the ApplyFilter action on this window. I have also tried to build a macro to requery and...
3
by: birt | last post by:
I know I am getting in my own way .... so someone please save me from myself! I created a form and rather than force the users to scroll through all the records to find theirs I decided to have...
3
by: Soulspike | last post by:
Form name to filter = frmSortFor Filter based on list box from frmTest= lstSortFor Form containing list box = frmTest Field (CompCodes) data format = "PM SM TS EW WA" I have a database that I...
0
by: cephal0n | last post by:
Hi All! I have two table tblHome1, contains all the unique PinNo and tblHome2 contains a duplicated PinNo and description. I put an automatic numbering (ProdID) and set it as my index. What I want...
10
by: dbdb | last post by:
Hi, i create a chart in ms access based on my query, then i want my chart when is it open is only show value based on my criteria. i'll try to used it in the properties apply filter using the...
5
by: phill86 | last post by:
Hi, I have a form that I have applied a filter to by using combo boxes which works fine. Is there a way to apply that filter to the forms underlying query Here is the code that I use to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.