Controlling Tables

G

Guest

Hello. I am creating a database to keep information for my customers and to track expenses and invoices related with their project. I created a table called "Customers" to track my customers and a table called "Project" to track projects related with each client. I created a button on my "Customers" form to open the "Projects" form. I want that when I click on the button only the project information relating to that specific customer to show up. On my "Project" form I placed a field called "ClientID" which is filled with the "CustomerID" from the "Customers" form. How can I make the "Project" form to search the "Project" table and only show the information relating to that customer

Ex.: I open a customer with "CustomerID" 1003 when I click the Project button the form Project opens and displays the project information related only to "ClientID" 1003

Any help would greatly be appreciated

Thank You in advance.
 
C

Cheryl Fischer

Have you tried using the Command Button Wizard? When you drag a command
button to your form's design the Wizard's prompts will:

1. Ask you what operation you want to perform. You would select Form
Operations from the list box labeled "Categories".

2. When you select "Form Operations", the list box labeled "Actions" will
then show you available actions for forms. You would select "Open Form".

3. The next prompt will show you a list of forms from which to select.

4. After you select the desired form, the next prompt will ask you: "Do
you want the button to find specific information to display in the form?"

5. For the kind of operation you describe in your post, you would need to
select the first-listed option: "Open the form and find specific data to
display."

6. The next prompt will show you fields from your Main form in the
left-hand list box and fields from the selected form in the right-hand list
box. All you have to do is identify the field from the Main form (Customer
ID) which should match the field in the selected form (Client ID), click on
each and then click on the button ( <=> ) between the list boxes.

7. Click "Next" and answer the prompts about naming your button - and you
are done. Access will have written all the code you need to open the
desired form with records that will match your Main form.

hth,

--
Cheryl Fischer
Law/Sys Associates
Houston, TX

HFChavarria said:
Hello. I am creating a database to keep information for my customers and
to track expenses and invoices related with their project. I created a
table called "Customers" to track my customers and a table called "Project"
to track projects related with each client. I created a button on my
"Customers" form to open the "Projects" form. I want that when I click on
the button only the project information relating to that specific customer
to show up. On my "Project" form I placed a field called "ClientID" which
is filled with the "CustomerID" from the "Customers" form. How can I make
the "Project" form to search the "Project" table and only show the
information relating to that customer.
Ex.: I open a customer with "CustomerID" 1003 when I click the Project
button the form Project opens and displays the project information related
only to "ClientID" 1003.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top