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

filter a continuous form

158 100+
I have a continuous form that i need to filter by the contents of a textbox. The text box name is txtInvoiceNumber. This is what i have and it does not work....and its driving me crazy!!

Expand|Select|Wrap|Line Numbers
  1. Me.Filter = me.txtInvoiceNumber
  2. Me.FilterOn = True
Here's how it works, I have the user enter in customer data. When they press the "Create invoice" button then it passes the invoice number to the invoice form (not subform). I guarantee that the information is being pass successfully. This is where i need the invoice form filtered...am i anywhere near close!?

Thanks for your help
Matt
Sep 8 '08 #1
4 7672
Stewart Ross
2,545 Expert Mod 2GB
Hi Jollywg. It doesn't work because you aren't specifying the field you want to filter. The filter clause should be structured as if it is a WHERE clause in SQL, but without the word WHERE.

I don't know the name of the field you are filtering, or whether it is a number or a text field, so replace the name of the dummy field below with the actual field from your query or table on which your form is based, and use the first line if your invoice number is a number, the second if it is text:

Expand|Select|Wrap|Line Numbers
  1. Me.Filter = "[your invoice number field] = " & me.txtInvoiceNumber
  2. Me.Filter = "[your invoice number field] = '" & me.txtInvoiceNumber & "'"
-Stewart
Sep 8 '08 #2
Jollywg
158 100+
Here is how i am doing this...i had to modify the pseudo code you sent me.

Expand|Select|Wrap|Line Numbers
  1. Me.Filter = Me.txtInvoiceNum = "'" & varInvoiceNumber & "'"
  2. Me.FilterOn = True
Me.txtInvoiceNum is the textbox where the invoice number pop up in, and varInvoiceNumber is the string variable that the invoice number is assigned to when the invoice form is opened.

Right now the form does filter, it just filters to invoice number 0 (which doesn't exist) Any ideas?
Sep 9 '08 #3
Stewart Ross
2,545 Expert Mod 2GB
Hi. What you have is not correct; a filter is, as I said, a WHERE clause without the word WHERE. You can only filter upon a field from the underlying table or query which is the recordsource of your form.

What I provided to you in skeleton form was correct; your attempt at it is not. Please re-read what I posted.

By the way, the 0 in the filter property at present is not an invoice number - it is the true/false result of comparing two variables for equality, and 0 represents False, meaning there was no match between the two items compared. Your 'filter' comes down to the following:

set filter property to the result of (the value in the control txtInvoiceNumber) = (the value of varInvoiceNumber)

which is meaningless.

-Stewart
Sep 9 '08 #4
Jollywg
158 100+
OK my apologies...i wasn't understanding the code that i was supposed to be using. Me.filter = "[table field]" = filter value....i wasn't getting the "select" part of the line. Everything works wonderfully!

Thank you!
Sep 9 '08 #5

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

Similar topics

4
by: Kathy | last post by:
What is the standard technique for handling the fields in the following scenario on a continuous form? Multiple Divisions. Each Division has multiple Buildings. Each Building has a Supervisor. ...
3
by: Stewart | last post by:
Hi all! My (relatively small) database holds data on staff members and the projects (services) that they are assigned to. In my form frmStaff, I have a list of staff members - it is a...
2
by: bobh | last post by:
Hi All, In Access97 I have a form setup as a continuous form several of the bound controls have calculations that are done in the 'after update' event via VBA code and all works fine. My...
3
by: eighthman11 | last post by:
Using Access 2000. I have a continuous form which for simplicity sack has two fields Social Security Number and Last Name. In the header of the continuous form I have a textbox where you can...
3
by: Steve | last post by:
Is there a way to put a main form/subform in a continuous form so I can scroll through all the records in the main form? Thanks!
3
by: dmcp | last post by:
hi i have a combo box in continuous form is there a way that i can filter the combo as i write in it?
3
by: Jollywg | last post by:
I have a continuous form with 5 columns (Qty, PartNum, Desc, ItemCost, TotalCos). At the bottom of the form i have a field labeled Invoice Total. Right now the Invoice Total is totaling everything...
4
by: Adam Tippelt | last post by:
Situation: I'm using a continuous form to display a lot of information stored in a datasheet. I'm using the form because it allows me to display multiple rows of information per 'record' which is...
2
by: Ian Anderson | last post by:
Hello there, SO i have the followign VB code in my continuous form... 'Purpose: This module illustrates how to create a search form, _ where the user can enter as many or few...
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...
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
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
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.