Button to search data in form view.

dwcrockford

New Member
Joined
Sep 1, 2015
Messages
27
I am trying to design a button (on a Dashboard Form), that will open a specific record in another form.

So, I need the button to Open the form, search specific term(number in this case), in a specific field (ID - indexed, no dups).

So by clicking on the button on the "dashboard", a message will pop up to enter the criteria to be searched for, and when that is completed (and ok or enter is pressed), the associated form will search for and open a single record that matches the criteria.

The associated table name is "Work Order", and the field in which I want to search is "WONumber".

I know the combo box version, however that would need to be on the Work Order form, not on the external Dashboard (named "ServiceCalls")

Am I asking too much of Access?
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Am I asking too much of Access?
Absolutely not. This is very basic, but like everything else, the best approach depends on your wants and situation.
If the form's recordsource is a query (and that query has a parameter defined for the work order number), the button click could be to open the form. When the query is called by the form, an input box will be presented to the user to enter the number. The query will run and the form will open with however many records are returned by your query. This is the simplest approach I can think of, but the disadvantage is that the user input cannot be validated. The query will run even if the user enters nothing before clicking OK. Simplest is often best, so if this satisfies the requirements and users are competent in supplying the values properly, you should go this way.

To add a validation step would require some code that presents an "input box" after switchboard button click. If the entry must be an existing value, it can be searched for and if not found, present a message and terminate the process. If this is only for creating new, I believe an input mask can be used in conjunction with the input box. As a user, I've just never liked input masks so I don't foist them on others. Then more code to open the form and pass the input value to the query.
 
Last edited:
Upvote 0
Absolutely not. This is very basic, but like everything else, the best approach depends on your wants and situation.
If the form's recordsource is a query (and that query has a parameter defined for the work order number), the button click could be to open the form. When the query is called by the form, an input box will be presented to the user to enter the number. The query will run and the form will open with however many records are returned by your query. This is the simplest approach I can think of, but the disadvantage is that the user input cannot be validated. The query will run even if the user enters nothing before clicking OK. Simplest is often best, so if this satisfies the requirements and users are competent in supplying the values properly, you should go this way.

To add a validation step would require some code that presents an "input box" after switchboard button click. If the entry must be an existing value, it can be searched for and if not found, present a message and terminate the process. If this is only for creating new, I believe an input mask can be used in conjunction with the input box. As a user, I've just never liked input masks so I don't foist them on others. Then more code to open the form and pass the input value to the query.

Thanks.... I figured it could be done (in one way or another). The form itself that is displaying information is an "data entry form" that displays data from a table (or variety of tables).

And do I need to do this (via macros etc) in stages? For example. On the "Dashboard", the "search for record" simply opens a small "window" associated to a query (yet to be designed), and then the "OK" button in that small window runs another "macro" for searching the specific field and related form?

I am re-learning Access 2013 after years of no exposure (since about '97), so although I understand concepts, many things are now different. Any step-by-step guidance is appreciated.
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,198
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top