Hi,
I'm trying to avoid writing any queries at all and installed use the VBA code to do SQL.
I have a form in which I have a combo box (cboClient)allowing people to either select their client with the drop down or to manually type it in until their client appears. Once they have their client they should have the client's industry show up in an unbound textbox (txtIndustry).
I've written the query in order to do so and it runs fine:
SELECT [Client Industry].[Industry]
FROM Clients LEFT JOIN [Client Industry] ON [Clients].[ClientId]=[Client Industry].[ClientID]
WHERE ((([Clients].[ClientId])=[forms]![frmEnterIndustry]![cboClient]));
The problem I'm having is to have the industry appear in the text box.
basically I want the after_update event to trigger the code to populate the txtIndustry box. The part I'm hung up on is this...
me!txtIndustry= DoCmd.RunSQL strSQL
I made the SQL statement a string. I know this is not the correct syntax to pull in the info but you can see what I want done. If anyone could help I would appreciate it.
I know this is probably pretty simple. I appreciate the help
Thanks
Tom
I'm trying to avoid writing any queries at all and installed use the VBA code to do SQL.
I have a form in which I have a combo box (cboClient)allowing people to either select their client with the drop down or to manually type it in until their client appears. Once they have their client they should have the client's industry show up in an unbound textbox (txtIndustry).
I've written the query in order to do so and it runs fine:
SELECT [Client Industry].[Industry]
FROM Clients LEFT JOIN [Client Industry] ON [Clients].[ClientId]=[Client Industry].[ClientID]
WHERE ((([Clients].[ClientId])=[forms]![frmEnterIndustry]![cboClient]));
The problem I'm having is to have the industry appear in the text box.
basically I want the after_update event to trigger the code to populate the txtIndustry box. The part I'm hung up on is this...
me!txtIndustry= DoCmd.RunSQL strSQL
I made the SQL statement a string. I know this is not the correct syntax to pull in the info but you can see what I want done. If anyone could help I would appreciate it.
I know this is probably pretty simple. I appreciate the help
Thanks
Tom