Setting up Forms and Search buttons

jenchildre

New Member
Joined
Nov 4, 2003
Messages
3
I am setting up a form that will contain several command buttons that will pull reports from my tables and queries. I have a table that I need a command button that I can but a part number into and it will search that table and return the field I have chosen. We need to look up comments for certain part numbers, this seemed easiest. :oops:
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Start by creating a new query with the fields that you want to be able to see, including the part number and save this.
Create a form based on the query that you have just made and add the wanted fields.
Now add a combobox (using the wizard) based on the same table as the query and select part number as it only field. When you get the choice, make sure that you select "Remember the values for later use." Once you have created the combobox go to its property sheet and create a code event for its AfterUpdate event. You need a line of code like Forms![MyForm].Requery (Changing "MyForm" to the name of your form.).

Reopen the query and under the part number add a criteria looking at the combobox that you have just created.
This will look like [Forms]![MyForm]![MyBox] (change the names to your names!) save and close.

You should save the form again and close it and then reopen it to make sure that it has picked up the changes to the query.

Now when you select a part number using the combobox the other fields should show just the details for that record.

HTH

Peter
 
Upvote 0

Forum statistics

Threads
1,221,645
Messages
6,161,044
Members
451,682
Latest member
ogoreo

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