Very easy macro question (probably)

R

requeth

Ok, here's what I have. I have a table called EFIO_Form1, which holds
all of my data. One field of this is called EFIOID. The data for this
field comes from a table called EFIO_TABLE. I then have a search box
that I can open, called Form1, with a field called EFIOIDSearch. My
goal is I enter a 6 digit number in this field, it runs a filter on the
EFIO_Form1 to get me to the correct record, then it will close the box.
I'm trying to set a macro to do this. As easy is this seems to me I'm
having an issue.

Macro:
OpenForm

Set to:
Form Name: EFIO_Form1
View: Form
Filter Name:
Where Condition:[EFIO_TABLE]![EFIOID]=[Forms]![Form1]![EFIOSearch]

I've tried several other options but this at least returns the first
record, instead of a blank new form to create a new record.

I'm in Access 2000, and I'd normally tackle this in code, but I'm not
sure exactly how in this situation, I tried but ended up causing some
wonderful errors. Any ideas?

Thanks,
RT Starid
 
K

kingston via AccessMonster.com

I'm not sure I fully understand because it seems you got it to work with your
macro, but here are a few suggestions to this common problem:

Use the built-in Filter By Form function (Records -> Filter -> Filter By Form)
 
R

requeth

Sorry, busy and having to type fast.

I run my macro, and want to find the record with an EFIOID of 12345
let's say, which happens to be the 40th of 300 records. When I actually
run my macro though, it returns 11111, which is the 1st of 300 records.
Regardless of what I put in to find, it always returns the first of 300
records. I was guessing my system would be so overly simplistic I
couldnt break it very easily, but I guess I'm wrong ;).
 
R

requeth

Ok, one step closer I think. I just realized that when I open the
database, the first thing that I enter into my search box and run the
macro on sticks, so whenever I run the macro after, it keeps displaying
the results of the first search. Is there a way to clear the macro
results after it searches, or before a new search even?

Thanks!
 
K

kingston via AccessMonster.com

Did this ever work for you? I think you need to change this:

Where Condition:[EFIO_TABLE]![EFIOID]=[Forms]![Form1]![EFIOSearch]

to this:

Where Condition:[EFIOID]=[Forms]![Form1]![EFIOSearch]
 
R

requeth

Negative. I'm still having issues with it only taking the first search.
Did this ever work for you? I think you need to change this:

Where Condition:[EFIO_TABLE]![EFIOID]=[Forms]![Form1]![EFIOSearch]

to this:

Where Condition:[EFIOID]=[Forms]![Form1]![EFIOSearch]

Sorry, busy and having to type fast.

I run my macro, and want to find the record with an EFIOID of 12345
let's say, which happens to be the 40th of 300 records. When I actually
run my macro though, it returns 11111, which is the 1st of 300 records.
Regardless of what I put in to find, it always returns the first of 300
records. I was guessing my system would be so overly simplistic I
couldnt break it very easily, but I guess I'm wrong ;).
 
K

kingston via AccessMonster.com

If this never worked for you then there's something else going on. Your best
bet might be to approach this from a different angle. Maybe use a subform
based on a query or just base the form on a query.

Negative. I'm still having issues with it only taking the first search.
Did this ever work for you? I think you need to change this:
[quoted text clipped - 16 lines]
 
R

requeth

I'm finding it odd that when I load the project the filter will work
once. But then keep returning the result from the first filter search
instead of the new search criteria. Basically I'm trying to make a pop
up search box that I can use, without using the finder since I'm
worried that if people have to choose the field and then hit my finder
box, they are going to wipe out the field. This wont be used by people
with any technical knowledge. Any ideas how I could do the search box
with limited effort on my part? I'm getting lost in how Microsoft broke
access 2000.

If this never worked for you then there's something else going on. Your best
bet might be to approach this from a different angle. Maybe use a subform
based on a query or just base the form on a query.

Negative. I'm still having issues with it only taking the first search.
Did this ever work for you? I think you need to change this:
[quoted text clipped - 16 lines]
Use the built-in Filter By Form function (Records -> Filter -> Filter By Form)
 
Top