changing textbox with query (count > 0)

B

Banaticus

How would I go about getting something like the following to work?

Private Sub Form_Load()
IF SELECT COUNT(1) FROM [App Info] INNER JOIN [Class Info] ON [App
Info].[Soc Sec #]=[Class Info].[Soc Sec] WHERE [Class Info].[Class Name]
alike "Qual%" > 0 THEN
[Qual Class Text Box].Text = (SELECT [Class Info].[Class Date] FROM [App
Info] INNER JOIN [Class Info] ON [App Info].[Soc Sec #]=[Class Info].[Soc
Sec] WHERE [Class Info].[Class Name] alike "Qual%"
End Sub
 
R

Rob Parker

Not sure if it's the most efficient way, but you could use domain aggregate
functions. You'd have code such as:

If dcount(...) then [Qual Class Text Box] = dlookup(...)

You'll need to save the SQL statements as queries so that you can refer to
them in dcount and dlookup functions.

HTH,

Rob
 

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