Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: [access]


Message #1 by Michelle Madden <MichelleM@a...> on Wed, 21 Mar 2001 09:44:23 -0000
Hi,



Can anyone help again?



I have two fields COMPANY and CONTACT, both these fields are combo boxes.

What I would like is to select a company in the first field, and the second

field only display the contacts belonging to that company.



The fields are updating a table of call information, but the records

themselves come from COMPANY_INFORMATION and CONTACT_INFORMATION with the

join being COMPANY_ID.



As this is all very new to me I have tried various things without success

and don't know any VB code. 



Can I do this with a select statement and select all the columns where the

company_id is equal to the company_id entered in the form field? Or is there

another way of doing this?



Thanks 



Michelle



Message #2 by Tim Mccurdy <tmccurdy@c...> on Wed, 21 Mar 2001 09:22:42 -0500
What you want to do is first populate the Companies Combo with its data.

Disable the Contacts Combo until they Select an Entry in the Companies

Combo.  Use the "Change" Event of the Companies Combo to then generate a SWL

Statement to Select the appropriate Contacts for that Comapnay.



Select * From Contacts Where CompanyName = '" & cboCompany.Text & "' Order

By ContactLastName"



Then enable the Contacts Combo after its populated.  If the user makes a

different Selection in the Companies Combo, it will then run again.  Make

sure to disable the Contacts Combo when they delete the Text in the

Companies Combo.  Also make sure to Validate the Text of the Combo to make

sure it isn't "" /  vbNullString.



-----Original Message-----

From: Michelle Madden [mailto:MichelleM@a...]

Sent: Wednesday, March 21, 2001 4:44 AM

To: Access

Subject: [access] [access]





Hi,



Can anyone help again?



I have two fields COMPANY and CONTACT, both these fields are combo boxes.

What I would like is to select a company in the first field, and the second

field only display the contacts belonging to that company.



The fields are updating a table of call information, but the records

themselves come from COMPANY_INFORMATION and CONTACT_INFORMATION with the

join being COMPANY_ID.



As this is all very new to me I have tried various things without success

and don't know any VB code. 



Can I do this with a select statement and select all the columns where the

company_id is equal to the company_id entered in the form field? Or is there

another way of doing this?



Thanks 



Michelle








Message #3 by Michelle Madden <MichelleM@a...> on Thu, 22 Mar 2001 19:49:05 -0000
Hi Tim,



Thanks very much for your help, but can I be a pain and ask you to elaborate

further on your instructions.  I basically understand what you suggest but

I've tried to implement it without success.  My background isn't programming

and I have had any formal training in Access, what I know is self taught,

although I know basic SQL scripting although its been a while since I

actually practiced it.



Hope this is OK.



Michelle

 



-----Original Message-----

From: Tim Mccurdy [mailto:tmccurdy@c...]

Sent: 21 March 2001 14:23

To: Access

Subject: [access] RE: [access]





What you want to do is first populate the Companies Combo with its data.

Disable the Contacts Combo until they Select an Entry in the Companies

Combo.  Use the "Change" Event of the Companies Combo to then generate a SWL

Statement to Select the appropriate Contacts for that Comapnay.



Select * From Contacts Where CompanyName = '" & cboCompany.Text & "' Order

By ContactLastName"



Then enable the Contacts Combo after its populated.  If the user makes a

different Selection in the Companies Combo, it will then run again.  Make

sure to disable the Contacts Combo when they delete the Text in the

Companies Combo.  Also make sure to Validate the Text of the Combo to make

sure it isn't "" /  vbNullString.



-----Original Message-----

From: Michelle Madden [mailto:MichelleM@a...]

Sent: Wednesday, March 21, 2001 4:44 AM

To: Access

Subject: [access] [access]





Hi,



Can anyone help again?



I have two fields COMPANY and CONTACT, both these fields are combo boxes.

What I would like is to select a company in the first field, and the second

field only display the contacts belonging to that company.



The fields are updating a table of call information, but the records

themselves come from COMPANY_INFORMATION and CONTACT_INFORMATION with the

join being COMPANY_ID.



As this is all very new to me I have tried various things without success

and don't know any VB code. 



Can I do this with a select statement and select all the columns where the

company_id is equal to the company_id entered in the form field? Or is there

another way of doing this?



Thanks 



Michelle




  Return to Index