Re: Eval("Name of Field")

From: Gijs Beukenoot (gijs.beukenoot_at_wanadoo.nl)
Date: 11/29/04


Date: Mon, 29 Nov 2004 15:26:45 +0100

Na rijp beraad schreef MDB-HZA :
> A column in a query:
> Data: Eval(FieldName())
>
> In a general Module:
> Public Sub FieldName() As String
> FieldName = "Name of Field"
> End Sub
>
> when run, the query should EVALUATE the name of the field returned in the
> query and look up the value of that field for each record. Instead it puts
> "Name of Field" in each record. Would not the purpose of evaluate be to
> change from a string to code?

It's doing exactly as you code. The function returns "Name of Field" so
that's what you get in your query... I'm not sure what you'd expect it
to return, please explain a little bit further...

-- 
Your eyes are weary from staring at the CRT. You feel sleepy. Notice 
how restful it is to watch the cursor blink. Close your eyes. The 
opinions stated above are yours. When I snap my fingers, you cannot 
imagine why you ever felt otherwise. <snap>


Relevant Pages

  • Re: Problems with Delete Command
    ... The SQL could get fairly messy if you need to construct it in code, ... ContactID, and WebComID, and create your on-the-fly SQL on that saved query, ... to find the list of ContactIDs from the junction table, ... This is a style/readability thing: if you are going to use string ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Need help with Code Please!!!
    ... the actual string that gets built at the end of the SQ1 build process. ... The message says Syntax error in query expression ... Dim rs As Recordset 'object ref to qryCompany\USFNumber ...
    (microsoft.public.access.formscoding)
  • Re: Need help with Code Please!!!
    ... putting the query SQL itself in here maybe it will help you understand what I ... the actual string that gets built at the end of the SQ1 build process. ... Dim rs As Recordset 'object ref to qryCompany\USFNumber ... Dim qd As QueryDef 'object ref to query item ...
    (microsoft.public.access.formscoding)
  • Re: Need help with Code Please!!!
    ... the actual string that gets built at the end of the SQ1 build process. ... The message says Syntax error in query expression ... Dim rs As Recordset 'object ref to qryCompany\USFNumber ...
    (microsoft.public.access.formscoding)
  • Re: Error using " in .open with ADODB.Recordset
    ... recordset but I'm getting hung up on the SQL statement. ... query that has a string as a condition. ... Dim mrk As String ...
    (microsoft.public.data.ado)