473,399 Members | 3,656 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,399 software developers and data experts.

Filtering a form works in 2.0 not in XP

Hi,

I have this form I want to open, and filter the records.

This is the forms recordsource:
SELECT A.CustID, A.Name
FROM TblCustomers AS A

this is a filter-query "qryFindItems":
SELECT A.*
FROM TblCustomers AS A INNER JOIN (jointable AS B INNER JOIN TblKort ON
B.KortID = TblKort.KortID) ON A.CustID = B.CustID
WHERE (((TblKort.StamNr) Like Cnull([forms]![frmhoved]![field4],'*')))

I then do:
DoCmd.OpenForm "frmResult", , "qryFindItems"

This works great in A2.0, but in AXP it stops and complains that is doesn't
know about TblKort.StamNr.

Any hints ?

/jim
Nov 12 '05 #1
1 1267
Hi Jim

There are indeed cases where later versions of Access do not use the Filter
property in the way that Access 2 did.

The easiest solution is probably one of these:
- Reassign the RecordSource of the form. That looks easy enough:
strSQL = "SELECT A.* FROM TblCustomers AS A INNER JOIN (jointable AS B
INNER JOIN TblKort ON B.KortID = TblKort.KortID) ON A.CustID = B.CustID
WHERE ...
Me.RecordSource = strSQL

Use the Filter property of the form (if you want the user to be able to
remove the filter easily). You can use a subquery in the form's Filter so it
limits the records.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Jim Andersen" <jimVÆÆK@officeconsult.dk> wrote in message
news:bu**********@sunsite.dk...

I have this form I want to open, and filter the records.

This is the forms recordsource:
SELECT A.CustID, A.Name
FROM TblCustomers AS A

this is a filter-query "qryFindItems":
SELECT A.*
FROM TblCustomers AS A INNER JOIN (jointable AS B INNER JOIN TblKort ON
B.KortID = TblKort.KortID) ON A.CustID = B.CustID
WHERE (((TblKort.StamNr) Like Cnull([forms]![frmhoved]![field4],'*')))

I then do:
DoCmd.OpenForm "frmResult", , "qryFindItems"

This works great in A2.0, but in AXP it stops and complains that is doesn't know about TblKort.StamNr.

Any hints ?

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Aionius | last post by:
Good day to all. I have this problem in JavaScript. I have a form (textbox) which accepts a series of numbers in format 9999-9999-9. Now i want to filter all inputs to the textbox. let's say...
7
by: Nathan Bloomfield | last post by:
Hi All, I am hoping someone out there will be kind enough to find out where my code is going wrong. The current code is inefficiant but hopefully it will convey the data I require to be...
2
by: Aravind | last post by:
Hi folks. I have a form, frmHistory, which has 4 command buttons: Sort Title (cmdSortTitle), Sort Name (cmdSortName), Due Today (cmdDueToday), and Due List (cmdDueList). Sort Title and Sort...
1
by: Aravind | last post by:
Hi folks. My database project has the following: -------------------------------------------------------------------------------- tables: Member: MemName, MemNo , MemType, CourseFaculty...
2
by: Sean | last post by:
Greetings all, I am attempting to make a form that will filter through several tables that (I believe) have refretial integrity. I am pulling data from several tables into the form and i would...
1
by: Samuel | last post by:
Why my Crystal Report form works on the machine I installed VB.NET, not works on the machine without VB.NET? Thanks.
4
by: Dave | last post by:
I am having difficulty filtering a form as the user types in a onchange event here is my code strFilter = cboCriteria.Value & " LIKE '" & Me!txtCriteria.text & "*" & "'" If Len(strFilter ) 0...
0
by: Mark Sandfox | last post by:
I have a simply email form using smtpmail.send. This form works on 99% of computers but does not work on my customers computer. He gets the generic runtime error. Again when tested on every...
4
by: novoselent | last post by:
This seems like it should be an easy thing, but I think I'm missing something simple here...or I'm just going about it all wrong... Using Access 2003 I have a form that lists vehicle service...
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: 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: 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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.