[AccessD] Help with function

Wortz, Charles CWortz at tea.state.tx.us
Thu Mar 6 07:52:01 CST 2003


Gustav,

Very good point.  I overlooked that in my reply.  It's true, just
referencing a query does not execute it.

Charles Wortz
Software Development Division
Texas Education Agency
1701 N. Congress Ave
Austin, TX 78701-1494
512-463-9493
CWortz at tea.state.tx.us



-----Original Message-----
From: Gustav Brock [mailto:gustav at cactus.dk] 
Sent: Thursday 2003 Mar 06 07:46
To: Hollis,Virginia
Subject: Re: [AccessD] Help with function


Hi Virginia

Don't hit me, but you can't do this:

  If Not IsNull("qry_EvaluatorNull.evaluatorID") Then

You need to open a recordset and evaluate .RecordCount ...

/gustav


> I am trying to write a function that will open a form with a filter. I

> can't seem to get it in the correct order. I tried it two different 
> ways as shown below. If the evaluator has been assigned, I do not want

> the form to open, the message "All assigned" should show.
 
> In the first try, the message does not show at all. The second try, 
> the message works, but the form still opens, so I added the last line 
> of DoCmd.Close acform, "frm_RCSE". The form shows then closes. I would

> like the form not to even show. I tried adding an On Error Resume 
> Next, but that did not work either, the form still opened & then 
> closed.
 
> Virginia
 
> *******One Way**********
> Function NoEval()
>     If Not IsNull("qry_EvaluatorNull.evaluatorID") Then
>         DoCmd.OpenForm "frm_RCSE", acNormal, "qry_EvaluatorNull", , 
> acFormEdit, acWindowNormal
>     Else
>         MsgBox "All RCSEs have been assigned to an Evaluator"
>         DoCmd.Close acForm, "frm_RCSE"
>     End If
> End Function



More information about the AccessD mailing list