G
Guest
I work with two different versions of Access, A2K(home) & A2K2(work).
For A2k2, I was able to create a form (in justified layout) that has one
area that displays record data and another area that you can enter in data
that would requery and update the results in the record data area. Once
opened, the form will display all records from its derived table, but if you
would like to search for records by specific fields, you can use the search
fields area.
The way I did this was:
1st - create the form based on my table
2nd - surface the field list and add the fields that I would like to search
by to the form
3rd - delete the contol source data for each search field
4th - create a query based on the table, where each field I would search on
from my form has this for it's criteria (Like
Nz([Forms]![MyForm]![MyField],"*"))
5th - create a macro where if the search on those fields produced no results
(DCount("*","MyQuery")=0), then a MsgBox surfaces and stops the macro. But if
results exist, then OpenForm where my query is the filter. This really just
refreshes the form with updated results.
6th - create a button of my form to run the macro
7th - I created custom record navigation buttons to search through records
since the focus is always on the button and if I use the forms default record
nav buttons, it would actually execute the button until I release the focus
from the button.
This works great in A2k2, but when I create the same setup in A2k, I receive
the "cancelled previous action" message when I execute the button/macro. The
message disappears when I delete the conditional rows in the macro.
I say all that to ask, is there's a way to do what I need to do in A2k that
I can do in A2k2?
For A2k2, I was able to create a form (in justified layout) that has one
area that displays record data and another area that you can enter in data
that would requery and update the results in the record data area. Once
opened, the form will display all records from its derived table, but if you
would like to search for records by specific fields, you can use the search
fields area.
The way I did this was:
1st - create the form based on my table
2nd - surface the field list and add the fields that I would like to search
by to the form
3rd - delete the contol source data for each search field
4th - create a query based on the table, where each field I would search on
from my form has this for it's criteria (Like
Nz([Forms]![MyForm]![MyField],"*"))
5th - create a macro where if the search on those fields produced no results
(DCount("*","MyQuery")=0), then a MsgBox surfaces and stops the macro. But if
results exist, then OpenForm where my query is the filter. This really just
refreshes the form with updated results.
6th - create a button of my form to run the macro
7th - I created custom record navigation buttons to search through records
since the focus is always on the button and if I use the forms default record
nav buttons, it would actually execute the button until I release the focus
from the button.
This works great in A2k2, but when I create the same setup in A2k, I receive
the "cancelled previous action" message when I execute the button/macro. The
message disappears when I delete the conditional rows in the macro.
I say all that to ask, is there's a way to do what I need to do in A2k that
I can do in A2k2?