RE: If one value then fill out other values
- From: ant1983 <ant1983@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 7 Feb 2008 08:33:01 -0800
Hey!!!
Thanks for your response!! I think i get it except for the very first part:
You do that by filtering the Client combo row source on the value in the >Company Combo. You will want the bound column of the Company Combo to be the CompanyID.
:O Please can you explain that in english? :)
Cheers mate!
"Klatuu" wrote:
The first thing you asked is called Cascading combos. You do that by.
filtering the Client combo row source on the value in the Company Combo. You
will want the bound column of the Company Combo to be the CompanyID. Then in
the After Update event of the Company Combo, you requery the Client Combo:
Private Sub cboCompany_AfterUpdate()
Me.cboClient.Requery
End Sub
Then to populate the controls on the form with the client info, you use the
After Update event of the Client combo. To have the values available,
include all the fields from tblClient you want to use in the combo's row
source. You can set the column widths property so that only the Client Name
shows in the list. The row source would be like:
SELECT ClientID, ClientName, ClientEmailAddress, ClientContractNumber FROM
tblClient WHERE autCompanyID = Me.cboCompany;
Private Sub cboClient_AfterUpdate()
With Me
.txtClientID = .cboClient.Column(0)
.txtClientName = .cboClient.Column(1)
.txtClientEMail = .cboClient.Column(2)
.txtClientContact = .cboClient.Column(3)
End With
--
Dave Hargis, Microsoft Access MVP
"ant1983" wrote:
I have the following tables with the following (simplified) structures:
tblCompany
- autCompanyID
- txtCompanyName
- txtCompanyCountry
tblClient
- autCompanyID (linked to above table)
- autClientID
- txtClientName
- txtClientEmailAddress
- txtClientContactNumber
What I want to achieve is to have a form where, when I select the Company
Name from a drop down box another drop down box, txtClientName, should be
populated with only the clients within that company.
That’s the first thing I want. The 2nd is to, when a Client Name is
selected this should fill out the remainder of the fields. i.e. if John
Smith was selected then John Smith’s Email Addy and Contact number should be
filled out.
I don’t even know where to start!!! Pls help!! Much appreciated!!!!
- Follow-Ups:
- RE: If one value then fill out other values
- From: Klatuu
- RE: If one value then fill out other values
- References:
- RE: If one value then fill out other values
- From: Klatuu
- RE: If one value then fill out other values
- Prev by Date: Re: User Define Array Data Type - Subscript out of range
- Next by Date: Form or report
- Previous by thread: RE: If one value then fill out other values
- Next by thread: RE: If one value then fill out other values
- Index(es):
Relevant Pages
|