473,413 Members | 2,044 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,413 software developers and data experts.

setting filter gives 'Automation Error'

I have a database in Access 2000 and I am opening a form then setting a filer to select a particular record. The code I am using is:-

Expand|Select|Wrap|Line Numbers
  1. stDocName = "fExtras"
  2.     DoCmd.OpenForm stDocName, acNormal
  3.  
  4.     Forms!fExtras.Filter = "Job_ID = " & Forms!jobs.Job_ID
  5.     Forms!fExtras.FilterOn = True
The form opens fine, but when the filter is set, the first line generates an error - "Automation Error"
I have almost identical code elswhere which works fine
Please has anyone any suggestions?

Wheelyjon
Sep 24 '07 #1
1 2000
Scott Price
1,384 Expert 1GB
I have a database in Access 2000 and I am opening a form then setting a filer to select a particular record. The code I am using is:-

Expand|Select|Wrap|Line Numbers
  1. stDocName = "fExtras"
  2.     DoCmd.OpenForm stDocName, acNormal
  3.  
  4.     Forms!fExtras.Filter = "Job_ID = " & Forms!jobs.Job_ID
  5.     Forms!fExtras.FilterOn = True
The form opens fine, but when the filter is set, the first line generates an error - "Automation Error"
I have almost identical code elswhere which works fine
Please has anyone any suggestions?

Wheelyjon
Welcome to the Scipts!

Also, non standard characters in field/control names usually require the use of square brackets: [] around the field name, i.e. [Job_ID]...

Try removing the space between the = and the " in your .Filter line.

Other than that make absolutely sure that all form references are spelled correctly.

Regards,
Scott
Sep 25 '07 #2

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

Similar topics

7
by: matthew_carver | last post by:
Hello, I have an ASP page that loops through a SQL Server 2000 table, then downloads an Excel sheet the users can save, etc. Works fine, except, I see that in one particular "comments" field the...
25
by: Neil Ginsberg | last post by:
I have a strange situation with my Access 2000 database. I have code in the database which has worked fine for years, and now all of a sudden doesn't work fine on one or two of my client's...
1
by: Will | last post by:
I have a combo box on a form which is based on table tblMachine. On that combo box I have four columns visible MachineNumber, description, location and type. The bound column is the MachineNumber...
4
by: Craig | last post by:
I'm trying to build a filter for a file search where the search will be able to filter out certain files according to certain "file properties", like Owner, Creation Date, etc. MS does this in...
8
by: David Lozzi | last post by:
Howdy, I have a user control that is a report to display data. On the page the control is inserted in, I have filter options to filter the report. When I try to do something like this, nothing...
1
by: singhneeta | last post by:
Hi all, I have a funny issue. I have a stored procedure that opens up as a datasheet. User can use the filter by selection option in Access to filter records. For some reson, some of the columns...
1
by: Bruce | last post by:
Hello, I know this must be something simple I'm overlooking but I can't get err.raise inside a class to return anything but 440 - automation error. For example, if I create the following test...
4
by: MLH | last post by:
I have an error #2473. I don't think it is related to References. I rolled out an A97 mde file that runs on several machines - but gives me this error on one workstation??? Here's the error: ...
1
by: The.Daryl.Lu | last post by:
Hi, two parts to my problem if someone can help address either one or both: 1. I want to SELECT everything in the table if it matches the criteria when the query button is pressed (this is just...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.