By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,652 Members | 1,911 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,652 IT Pros & Developers. It's quick & easy.

Need help with forms and applyfilter command

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.