By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,806 Members | 1,490 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,806 IT Pros & Developers. It's quick & easy.

reading entries in a recordset and performing tasks if something found

P: n/a
Hi,

have a record set consisting of 1 field.
Possible entries are 1, 2, 3, 4.1, 4.2, 4.3, 5.1, 5.2, 6.1, 6.2, 7, 8,
9, null
Goal is to read the RS and as it finds certain numbers that it prints a
cooresponding file, then moves on to the next until EOF.

Have tried a few things and still do not have a solution.

pretty sure I need 'do while not EOF' and 'loop', but trying to keep it
simple. My problem might be in setting and reading the variable.

I would greatly appreciate some air code to play with. Once completed I
will post the complete procedure for others to play with.

Help I am lost!

for reference, here is my sqlcode to pull the recordset.

SELECT Art_UN.Label_1 FROM TMP_pack INNER JOIN Art_UN ON
TMP_pack.UN_Typ = Art_UN.UN GROUP BY Art_UN.label_1;

Jan 17 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Still playing, got to this
How can I read the entry? It is correctly telling me I cannot edit, but
there is no 'read' or 'view'
What else can I try?

While Not rs_adr.EOF
With rs_adr
.edit
adrklasse = rs_adr!label_1
If adrklasse = 3 Then
Call fprintpdf("s:\labens\db\pdf\kl_3.pdf", WINMAX)
ElseIf adrklasse = 4.1 Then
Call fprintpdf("s:\labens\db\pdf\kl_41.pdf", WINMAX)
End If
.Update
End With
Wend

Jan 17 '07 #2

P: n/a
"stevenrec" <st***********@stevenrec.comwrote in
news:11*********************@v45g2000cwv.googlegro ups.com:
Still playing, got to this
How can I read the entry? It is correctly telling me I cannot edit, but
there is no 'read' or 'view'
What else can I try?

While Not rs_adr.EOF
With rs_adr
.edit
adrklasse = rs_adr!label_1
If adrklasse = 3 Then
Call fprintpdf("s:\labens\db\pdf\kl_3.pdf", WINMAX)
ElseIf adrklasse = 4.1 Then
Call fprintpdf("s:\labens\db\pdf\kl_41.pdf", WINMAX)
End If
.Update
End With
Wend

If you are just reading values you don't have to edit or update.

Very Air Code written while talking on telephone; probably has syntax
errors:

Dim Path$
Path = "s:\labens\db\pdf\kl_Identifier.pdf"
With rs_adr
While Not .EOF
fprintpdf Replace(Path,"Identifier", Replace(CStr(.Fields
("label_1").Value),".","")), WINMAX
' The above is all one line)
.MoveNext
Wend
End With
Jan 17 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.