Begging for help w/ macros

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've asked a couple of questions before but I have never recieved any
replies. I understand that anone who replies is volunteering their time but
PLEASE I need some help. I have a query with fileds taken from my tables. I
want to display some of those fields in a form and then use option groups to
filter out records. Ex. I have 152 samples with Sample Number as a primary
key. All of these samples have different measurements associated with them. I
want to display on 1 form (in maybe a list) 1-152. Then by selecting various
options from different option groups remove some of the samples from the
list. Is that possible? I've been trying to set up Applyfilter macros to the
options groups but I get type mismatches or nothing happens. I could use some
serious help. Thanks.
 
It's very difficult to give you specific, useful suggestions without more
specific details from you. What you're describing is a pretty generic
scenario.

What you seek to do is not necessarily a simple thing, and doesn't
necessarily involve a macro. It may be that you will want to use VBA code,
as what you seek to do might better be set up using a query that contains
criteria expressions that use values of controls on your form to filter the
data as you desire and then just requery the form whenever you change one of
those controls on the form.

Using ApplyFilter is not a way I'd do this.

Try creating a query for your form that returns all desired records/data.
Then for each field that you might want to filter out by a value (or filter
in by a value), put an expression in the criteria box that reads the value
froma form and uses that as the match value. Not knowing what types of
controls you'll have on your form to identify what to filter in or what to
filter out, it's difficult to say much more at this time.

Note that, if you're using a textbox whose value should be matched in order
to return a record with that value, and if the textbox is blank you want all
records, the criterion expression would be something like this:
Forms!FormName!TextBoxName Or Forms!FormName!TextBoxName Is Null
 
Try entering a criteria in the query as follows:[Enter Facility Code]. The
"Facility Code" was the name of the field.

Hope this helps
 
Can't you right click and filter the information the way you want on the
displayed files?
 
Back
Top