Count records from SQL

N

Nbene

Hi All,

Wondering if anyone can point me in the right direction.

I have a continuos form that has multiple combo boxes, after user
selects from these then presses GO it runs an SQL statement putting in
the appropriate parameters.

SQL = "SELECT tblOrganisation.OrganisationId, tblLUGroup.Group,
tblLUIndustry.Industry,"
SQL = SQL + " tblOrganisation.OName , tblOrganisation.OTown,
tblLUCountry.Country"
SQL = SQL + " FROM ((tblOrganisation LEFT JOIN tblLUGroup ON
tblOrganisation.OGroup ="
SQL = SQL + " tblLUGroup.GrouId) LEFT JOIN tblLUIndustry ON
tblOrganisation.OIndustry ="
SQL = SQL + " tblLUIndustry.IndustryId) LEFT JOIN tblLUCountry ON
tblOrganisation.OCountry = tblLUCountry.CountryId"
SQL = SQL + " WHERE (((tblLUIndustry.Industry)= '" & StrIndustry &
"'));"

This then becomes the record source then i requery.

On the top of the form i have a text box that counts the number if
records, which works fine for if the record source is a query but i am
not sure what to do when the domain, ie. record source is a SELECT
statement.

As the SQL statement changes depending on how many of the combo boxes
are selected I am not sure how to progress.

Any ideas would be greatly appreciated.

Regards

NB
 
J

Jeff Boyce

If that text box is unbound, and shows a calculated value, I believe you can
use
Me.Repaint
to get the screen updated in your unbound text boxes.

Since a "query" is just, underneath, a SQL statement, there should be no
difference between using a query and using a SQL statement as a source.

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 
N

Nbene

If that text box is unbound, and shows a calculated value, I believe you can
use
Me.Repaint
to get the screen updated in your unbound text boxes.

Since a "query" is just, underneath, a SQL statement, there should be no
difference between using a query and using a SQL statement as a source.

--
Regards

Jeff Boycewww.InformationFutures.net

Microsoft Office/Access MVPhttp://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentorhttp://microsoftitacademy.com/













- Show quoted text -

Hi Jeff,

Thanks for the reply.

Yes, all i need to to was laeve the query in the name and put in the
parameters, i coded this in VBA and then displayed the result in a
label.

Cheers

NB
 

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