Form based on Form

svtguy02

Registered User.
Local time
Today, 14:32
Joined
Apr 9, 2007
Messages
31
Hi all,

I've got a form that I need to be based on a table, but also based on the results of the previous form. I'll outline some tables below so you have a picture of how it works:

Customers:
CustomerID (PK AutoNumber)
Customer_Number
Customer_Name
Address
City
State
Zip

Facilities:
FacilityID (PK AutoNumber)
Facility_Name
Facility_Number
CustomerID (Related to PK in 'Customers')
Address
City
State
Zip

Contracts:
ContractInfoID
Contract_Number
EffectiveDate
CustomerID (Related to PK in 'Customers')
ContractStatus

Quotes:
QuoteID
Quote_Number
InstallDate
LiveDate
FacilityID (Related to PK in 'Facilities')
ContractInfoID (Related to PK in 'Contracts')

1 Customer can have Many Facilities and Many Contracts
1 Facility can have Many Quotes
1 Contract can have Many Quotes as well

I have a form based on the Contracts table and it has a Customer Name field where you select from a pull down menu, one of the existing customers, then fill out your form data to complete that entry.

After that I would like to create a form based on the Quotes table, and have the facilities that are available in the FacilityID field ONLY those that are related to the Customer that was chosen in the previous form.

Example. Lets say CustomerA has FacA, FacB, FacC, and CustomerB has FacD FacE, and CustomerC has FacF

You start on the first form and select CustomerB and create your entry. Click a continue button, then it pops up the form based on Quotes. I would like the facilities available to only be FacD and FacE considering CustomerB was selected in the form previous to the one you would be on currently.

I hope thats possible and that someone can help me out with htis! :) Thanks
 
As you open each subsequent form, use the Where argument of the OpenForm Method to filter each form as it opens. If necessary, you can also use the OpenArgs argument to pass the primary key.
 

Users who are viewing this thread

Back
Top Bottom