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

Need help with forms and applyfilter command

I have a database that I've converted from 8 seperate tables into one
cumulative table. instead of having 8 unique tables, there are 8
different tags now (machine1, machine2 etc) that ID every single
record. I've created a form, but i'm having a hard time filtering the
data out (i'm creating 8 seperate forms for each machine which all get
their data from one main table). so basically, i want the machine1
form to only show machine1 data, machine2 form to show machine2 data
etc... this is done through a hidden textbox on the form that holds
the machineID data.

this is the code i've tried to use:

DoCmd.Applyfilter, "[CumulativeSamplesDatabase].[MachineID] =
[Machine1Active]"

the idea of the code above was to only bring up records that have
"machine1active" in the MachineID field.
Nov 12 '05 #1
2 1431
How are you opening the Forms? If from VBA code, you can do one of two
things: Use the WhereCondition argument of DoCmd.OpenForms, or pick up an
SQL string to replace the RecordSource of the Form in the Form's Open Event.
I can't see any need at all to have separate identical Forms, unless you
want to just click them in the Forms tab of the Database window to open the
Form.

Larry Linson
Microsoft Access MVP

"webvigator2k" <we**********@yahoo.com> wrote in message
news:e2**************************@posting.google.c om...
I have a database that I've converted from 8 seperate tables into one
cumulative table. instead of having 8 unique tables, there are 8
different tags now (machine1, machine2 etc) that ID every single
record. I've created a form, but i'm having a hard time filtering the
data out (i'm creating 8 seperate forms for each machine which all get
their data from one main table). so basically, i want the machine1
form to only show machine1 data, machine2 form to show machine2 data
etc... this is done through a hidden textbox on the form that holds
the machineID data.

this is the code i've tried to use:

DoCmd.Applyfilter, "[CumulativeSamplesDatabase].[MachineID] =
[Machine1Active]"

the idea of the code above was to only bring up records that have
"machine1active" in the MachineID field.

Nov 12 '05 #2
8 separate forms is a bad idea... What a PITA if you need to apply changes !

There are several ways in which you can filter the records shown on the form.
'Query by Form' is easy to accomplish.
You need one combo on the 'calling form' (cboMachineID)
cboMachineID rowsource = Machine1; Machine2; Machine 3; ...
Base the form on a query where MachineID = Forms!CallingForm!cboMachineID

--
Hope this helps
Arno R
"webvigator2k" <we**********@yahoo.com> schreef in bericht
news:e2**************************@posting.google.c om...
I have a database that I've converted from 8 seperate tables into one
cumulative table. instead of having 8 unique tables, there are 8
different tags now (machine1, machine2 etc) that ID every single
record. I've created a form, but i'm having a hard time filtering the
data out (i'm creating 8 seperate forms for each machine which all get
their data from one main table). so basically, i want the machine1
form to only show machine1 data, machine2 form to show machine2 data
etc... this is done through a hidden textbox on the form that holds
the machineID data.

this is the code i've tried to use:

DoCmd.Applyfilter, "[CumulativeSamplesDatabase].[MachineID] =
[Machine1Active]"

the idea of the code above was to only bring up records that have
"machine1active" in the MachineID field.


Nov 12 '05 #3

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

Similar topics

2
by: Simon Radford via AccessMonster.com | last post by:
I have a form which contains a field that collects the MSysObjects list of queries within the system. Also on this form there is a button that is told to apply the query chosen by the user to a...
2
by: Susan Bricker | last post by:
Greetings. Before I begin, I have been stuck on this problem for about a 5 days, now. I have tried and just seem to be not getting anywhere. I know that the explanation is lengthy, but I am a...
4
by: Colin Spalding | last post by:
How can I use the ApplyFilter method when both the control source to be filtered, and the filter are variables. I have tried the following syntax: DoCmd.ApplyFilter , "strSubject ='" & strGroup...
3
by: Robert_5032 | last post by:
I cant get my filter to work with variables Its working fine if I "hardcode" the issueType I want to filter on. Works fine: DoCmd.ApplyFilter , "issueType = 1" Works NOT: DoCmd.ApplyFilter ,...
1
by: Robert | last post by:
Every thing worked fine until all of a sudden, I get the following error whenever I try to do anything on one of my forms that calls an Event Procedure. I get the error as soon as the form opens...
2
by: John Smith | last post by:
The following code will not work for filtering records on a form: DoCmd.ApplyFilter , "Award =" & Not Null I use the following line to filter for a series of Yes/No boxes without trouble: ...
1
by: zamir | last post by:
hi, can you applyfilter to a form based on what a user will enter in a login screen and have a specific record show up on that form. the code i already have is this: DoCmd.ApplyFilter ,...
1
by: paquer | last post by:
I have forms that are used in the office as well as in the field. I want user's to be able to print out an exact copy of the form for "in the field" data entry. (Yes we are still stuck in the 90's....
0
by: Romulo NF | last post by:
Greetings again everyone Recently i´ve been asked to develop a script to allow filtering in the content of the table, with dinamic options based on the own content. Example: a table with the name of...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.