changing textbox with query (count > 0)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
Back
Top