Re: Dynamic dimming



reusing the ssql variable is fine.

ssql's value *at the time a recordset is opened* is all that matters. the
recordset doesn't maintain any kind of reference/pointer back to the
variable.

HTH,

"Biggles" <Biggles@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E212CD79-1FFF-4EC6-BA34-7F75F1CE60A6@xxxxxxxxxxxxxxxx
Thanks Dirk, I will use that method.

I posted the previous before I ran to a meeting, so now I have a follow up
question. Should I use different SSQL statements if I want to have
multiple
recordsets open, i.e.

SSQL1 = "Select ..."
RS1.openrecordset ssql1 'this needs to stay open
ssql2 = "Select ... "
RS2.openrecordset ssql2 'this needs to stay open as well

or is this method below courting danger:

SSQL1 = "Select ..."
RS1.openrecordset ssql1 'this needs to stay open
ssql1 = "Select ... "
RS2.openrecordset ssql1

Thanks.
--
Yours Fictionally, Biggles


"Dirk Goldgar" wrote:

In news:7561626A-1492-47AC-9936-844D28C00102@xxxxxxxxxxxxx,
Biggles <Biggles@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I wasn't even sure what to search this on, but can I do this?:

v_ctr = 1
Do Until v_ctr > 3
dim (ssql & v_ctr) as String
Loop

instead of:

dim ssql1 as string
dim ssql2 as string
dim ssql3 as string

No. But you can do this:

Dim ssql(1 To 3) As String

.... and then refer to the individual elements of the array using
subscripts.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)





.



Relevant Pages

  • Re: VBA Function Exits Unexpectedly
    ... >> Dim month As String, ... >> Dim rstagents As Recordset ... > Set rstAgents = New ADODB.Recordset ...
    (microsoft.public.access.modulesdaovba)
  • Re: How to add/load records to combobox ?
    ... Dim rsCustomers As New ADODB.Recordset ... Private msCustomerIDsAs String ... Private Sub Combo1_Click ... Dim sSQL As String ...
    (microsoft.public.vb.controls)
  • Re: macro error due to editor
    ... Your VBA code never sets DB or the Recordset variables to Nothing. ... Do you declare DB as a global variable anywhere in the database file (e.g., ... EmpDateAs String ... Dim DB As Database, Qry As QueryDef, Qry_def As String ...
    (microsoft.public.access.macros)
  • Converting Ole Objects containing linked addresses into hyperlinks
    ... Examining first occurrence of path in ole object only: ... Dim dbCurrent As Database, rs As Recordset, rs2 As Recordset, strDocPath As ... Dim strSQL As String, strDocInfo As String ...
    (microsoft.public.access.modulesdaovba)
  • Re: Edit/Update results in badly fragmented file
    ... Microsoft Jet objects when using DAO in *other* Microsoft Office programs. ... While the article discusses opening a recordset using DAO, ... Public Function ScrubValue (strMPN As String) As String ... Dim blnHasNum As Boolean ...
    (microsoft.public.access.modulesdaovba)