Re: DAO peculiarity in A97?
- From: "Wayne Morgan" <comprev_gothroughthenewsgroup@xxxxxxxxxxx>
- Date: Sat, 31 Dec 2005 14:53:14 GMT
If the recordset has no records, both BOF and EOF will be true at the same
time. So, in line 231, if there are no records then BOF should be true.
However, lines 230 through 250 are currently "commented out", so they aren't
executing.
You aren't showing the entire code. Make sure your End With statements line
up where you expect them to. If you were missing one, you should get a
compile error, but if it is misplaced, you won't get the compile error but
may get the error you're getting.
FYI, line 250 can be shortened to
Do Until .EOF
Which line gives the 91 error?
--
Wayne Morgan
MS Access MVP
"MLH" <CRCI@xxxxxxxxxxxxxx> wrote in message
news:kb3dr1d96b5ale01csrm8mr8hjsn866l63@xxxxxxxxxx
>I have noticed, in the following code snippet, that if
> tblCorrespondence has no records in it, I get an error
> 91 later during processing. It complains that an object
> variable or a With block variable has not been set. I
> have checked the code carefully and I don't think this
> is the case. I'm wondering if my code in line 231 might
> be flawed in light of the fact that qdfType17CorrespRecs
> returns no records?
>
> 140 With MyDB
> 170 Set qdfType17CorrespRecs = .CreateQueryDef("", "Select *
> FROM tblCorrespondence;")
> 180 With qdfType17CorrespRecs
> 210 ' Open Recordset from QueryDef.
> 220 Set rstType17CorrespRecs =
> .OpenRecordset(dbOpenSnapshot)
> 230 ' With rstType17CorrespRecs
> 231 ' If .BOF = True Then GoTo NoRecs
> 240 ' .MoveFirst
> 250 ' Do Until rstType17CorrespRecs.EOF
>
.
- Follow-Ups:
- Re: DAO peculiarity in A97?
- From: MLH
- Re: DAO peculiarity in A97?
- References:
- DAO peculiarity in A97?
- From: MLH
- DAO peculiarity in A97?
- Prev by Date: After insert of date how to auto jump to next field
- Next by Date: Re: DAO peculiarity in A97?
- Previous by thread: DAO peculiarity in A97?
- Next by thread: Re: DAO peculiarity in A97?
- Index(es):
Relevant Pages
|