public recordset

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • christianlott1@yahoo.com

    #1

    public recordset

    I have form code that declares a public recordset at the top:

    Public pubRS As DAO.Recordset

    I open a recordset and assign it:

    Set pubRS = rsSelect

    (printing current record from pubRS works here)

    I then call a public subroutine in a module and attempt to print the
    current record:

    Debug.Print "123---" & pubRS("TG_CNTRC T_ID")

    and I get:

    " Compile Error: Sub or Function not defined. "

    What did I do wrong?



    Thanks,

    Christian

  • christianlott1@yahoo.com

    #2
    Eval problems (was Re: public recordset)

    ok, I passed the recordset in as a parameter.

    I'm doing something a little non-standard:

    varReplaceWith = Eval(snpReplace Codes!ReplaceWi th)

    I do an Eval from a recordet where:

    snpReplaceCodes !ReplaceWith = passedRS!FieldN ame

    so in effect:

    varReplaceWith = Eval(passedRS!F ieldName)

    Stepping through the code, as soon as it hits the eval on that
    recordset, it returns from the subroutine (prematurely).

    I usually use this code with forms, so in effect:

    varReplaceWith = Eval(Forms!Form Name!FieldName)

    consistently works.

    Why won't this work on a recordset without being tied to a form?


    Christian

    Comment

    Working...