![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
"ron paii" <none (AT) nospam (DOT) com> wrote in news:j452dt$lqm$1 (AT) dont-email (DOT) me: "David-W-Fenton" <NoEmail (AT) SeeSignature (DOT) invalid> wrote in message news:Xns9F55A957D54D0f99a49ed1d0c49c5bbb2 (AT) 88 (DOT) 198.244.100... "ron paii" <none (AT) nospam (DOT) com> wrote in news:j3qi51$opb$1 (AT) dont-email (DOT) me: If (frm.RecordSource <> strsql) Then frm.RecordSource = strsql On Error GoTo fErr set rsClone = frm.RecordsetClone If (Not (rsClone .EOF)) Then rsClone .MoveLast lngCount = rsClone.RecordCount rsClone .MoveFirst End If set rsClone = Nothing Else frm.Requery End If This makes me crazy. There is simply NO REASON to set a variable pointing to the RecordsetClone -- just use a WITH structure and save the extra work: If (frm.RecordSource <> strsql) Then frm.RecordSource = strsql On Error GoTo fErr With frm.RecordsetClone If (Not (.EOF)) Then .MoveLast lngCount = .RecordCount .MoveFirst End If End With Else frm.Requery End If That's true, but I normally do more with the clone. So I find it easer to use a variable. What are you doing that makes it easier? What exactly are you doing with the form's RecordsetClone? That is, as opposed to the Clone of any old Recordset, which definitely requires a variable assignment to be used? -- David W. Fenton http://www.dfenton.com/ contact via website only http://www.dfenton.com/DFA/ |
#12
| |||
| |||
|
|
"ron paii" <n... (AT) nospam (DOT) com> wrote innews:j4523k$joq$1 (AT) dont-email (DOT) me: I always assumed that RecordSetClone created a new object, being as I could set multiple references to it and move the cursors independently. Hmm. Good point. I'll have to meditate on that one. But it's very clearly not a new object -- it exists already, since you don't have to initialize it in order to use it. Of course, maybe when you're assigning it to a variable you are getting a copy instead of the original object? I'll have to think a bit on how to test that out... -- David W. Fenton * * * * * * * * *http://www.dfenton.com/ contact via website only * *http://www.dfenton.com/DFA/ |
![]() |
| Thread Tools | |
| Display Modes | |
| |