如何定义循环 [英] How to define a loop

查看:94
本文介绍了如何定义循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

可以有人给我正确的语法来定义使用

表单'记录集的循环,只要它不在最后这个桌子?


例子:

做的不是EOF''这是我不知道的部分

命令....

.....

.....

循环


谢谢.....

解决方案




Ronny Sigo写道:
< Helloquote class =post_quotes>大家好,
任何人都可以使用
表单的记录集为我定义循环的正确语法,只要它不在表的末尾?

例如:
虽然不是EOF''这是我不知道的部分
命令......
..... /> .....
循环

谢谢.....




Dim rst记录集

设置rst = Currentdb.Openrecordset(" MyTable",dbopendynaset)

如果rst.Recordcount> 0然后

rst.MoveFirst

做的不是rst.EOF

....过程

rst。 MoveNext

循环

Endif

rst.close

set rst = Nothing


Hello Salad ...

感谢您的回复......

我按照您的建议尝试了它

现在我收到错误消息无效参数在我放的那一行

***********

tblFoutmeldingen确实存在....

这里是片段....


Dim rst记录集

Set rst = CurrentDb.Openrecordset(" tblFoutmeldingen",dbopendynaset)

***********

如果rst.RecordCount> 0然后

rst.MoveFirst

Do While Not rst.EOF

如果[Karel] = True那么

sBody = sBody& Apparaat: &安培;修剪([Apparaat])&

Beschrijving:" &安培;修剪([Beschrijving])& _

"基准: &安培; [DatumMelding]& " Gebruiker: &

修剪([Gebruiker])& vbCrLf& _

修剪([Gebruiker])& "探测器dit te herstellen遇见

volgende handeling(en): &安培;修剪([OndernomenActie])& vbCrLf& vbCrLf

[DatumMailKarel] =日期

结束如果

如果[Ronny] = True那么

ronnylogic = True

结束如果

rst.MoveNext

循环

结束如果

rst。关闭

Set rst = Nothing


" Salad" < oi*@vinegar.com> schreef在bericht

新闻:3F *************** @ vinegar.com ...



大家好,
任何人都可以给我正确的语法来定义一个循环使用
表单的记录集因为它不在桌子的尽头?

例如:
虽然没有EOF''这是我不知道的部分
命令....
.....
.....
循环

谢谢.....



昏暗rst作为记录集
设置rst = Currentdb.Openrecordset(" MyTable",dbopendynaset)
如果rst.Recordcount> 0然后
rst.MoveFirst
做的不是rst.EOF
....过程
rst.MoveNext
循环
Endif
rst .close
set rst = Nothing



您可能缺少对DAO库的引用。转到工具 - >参考,

看看DAO是否被选中。


" Ronny Sigo" < RO ******** @ skynet.be>在留言中写道

新闻:3f ********************** @ feed0.news.be.easyne t.net ...

Hello Salad ...
感谢您的回复...
我按照您的建议尝试了
现在我收到错误消息无效的参数在我放置的那一行
***********
tblFoutmeldingen确实存在....
这是片段....

Dim rst Recordset
Set rst = CurrentDb.Openrecordset(" tblFoutmeldingen",dbopendynaset)
***********
如果rst.RecordCount> 0然后
rst.MoveFirst
做的不是rst.EOF
如果[Karel] = True那么
sBody = sBody& Apparaat: &安培;修剪([Apparaat])&
Beschrijving: &安培;修剪([Beschrijving])& _
基准: &安培; [DatumMelding]& " Gebruiker: &
Trim([Gebruiker])& vbCrLf& _
修剪([Gebruiker])& "探测器dit te herstellen遇见了
volgende handeling(en): &安培;修剪([OndernomenActie])& vbCrLf& vbCrLf
[DatumMailKarel] =日期
结束如果
如果[Ronny] = True那么
ronnylogic = True
结束如果
rst.MoveNext
循环
结束如果
rst.Close
Set rst = Nothing

" Salad" < oi*@vinegar.com> schreef在bericht
新闻:3F *************** @ vinegar.com ...



Ronny Sigo写道:

大家好,
任何人都可以给我正确的语法来定义使用
表单的记录集的循环,只要它不是在桌子的最后?

例如:
做不EOF''这是我不知道的部分
命令....
.....
.....
循环

谢谢......



Dim rst Recordset
Set rst = Currentdb.Openrecordset(" MyTable",dbopendynaset)
如果rst.Recordcount> 0然后
rst.MoveFirst
做的不是rst.EOF
....过程
rst.MoveNext
循环
Endif
rst .close
设置rst =没什么




Hello all,
Could anybody give me the correct syntax for defining a loop using the
form''s recordset for as long as it is not at the end of the table ?

example:
Do While not EOF '' this is the part I don''t know
commands ....
.....
.....
Loop

Thanks .....

解决方案



Ronny Sigo wrote:

Hello all,
Could anybody give me the correct syntax for defining a loop using the
form''s recordset for as long as it is not at the end of the table ?

example:
Do While not EOF '' this is the part I don''t know
commands ....
.....
.....
Loop

Thanks .....



Dim rst As Recordset
Set rst = Currentdb.Openrecordset("MyTable",dbopendynaset)
If rst.Recordcount > 0 then
rst.MoveFirst
Do while not rst.EOF
....process
rst.MoveNext
Loop
Endif
rst.close
set rst = Nothing


Hello Salad ...
Thanks for responding ...
I tried it as you suggested
Now I get the error message "Invalid argument" at the line where I put the
***********
tblFoutmeldingen does exist ....
Here is the snippet ....

Dim rst As Recordset
Set rst = CurrentDb.Openrecordset("tblFoutmeldingen", dbopendynaset)
***********
If rst.RecordCount > 0 Then
rst.MoveFirst
Do While Not rst.EOF
If [Karel] = True Then
sBody = sBody & "Apparaat: " & Trim([Apparaat]) & "
Beschrijving: " & Trim([Beschrijving]) & _
" Datum: " & [DatumMelding] & " Gebruiker: " &
Trim([Gebruiker]) & vbCrLf & _
Trim([Gebruiker]) & " probeerde dit te herstellen met
volgende handeling(en): " & Trim([OndernomenActie]) & vbCrLf & vbCrLf
[DatumMailKarel] = Date
End If
If [Ronny] = True Then
ronnylogic = True
End If
rst.MoveNext
Loop
End If
rst.Close
Set rst = Nothing

"Salad" <oi*@vinegar.com> schreef in bericht
news:3F***************@vinegar.com...



Ronny Sigo wrote:

Hello all,
Could anybody give me the correct syntax for defining a loop using the
form''s recordset for as long as it is not at the end of the table ?

example:
Do While not EOF '' this is the part I don''t know
commands ....
.....
.....
Loop

Thanks .....



Dim rst As Recordset
Set rst = Currentdb.Openrecordset("MyTable",dbopendynaset)
If rst.Recordcount > 0 then
rst.MoveFirst
Do while not rst.EOF
....process
rst.MoveNext
Loop
Endif
rst.close
set rst = Nothing



You might be missing a reference to a DAO library. Go to Tools->References,
see if DAO is checked.

"Ronny Sigo" <ro********@skynet.be> wrote in message
news:3f**********************@feed0.news.be.easyne t.net...

Hello Salad ...
Thanks for responding ...
I tried it as you suggested
Now I get the error message "Invalid argument" at the line where I put the
***********
tblFoutmeldingen does exist ....
Here is the snippet ....

Dim rst As Recordset
Set rst = CurrentDb.Openrecordset("tblFoutmeldingen", dbopendynaset)
***********
If rst.RecordCount > 0 Then
rst.MoveFirst
Do While Not rst.EOF
If [Karel] = True Then
sBody = sBody & "Apparaat: " & Trim([Apparaat]) & "
Beschrijving: " & Trim([Beschrijving]) & _
" Datum: " & [DatumMelding] & " Gebruiker: " &
Trim([Gebruiker]) & vbCrLf & _
Trim([Gebruiker]) & " probeerde dit te herstellen met
volgende handeling(en): " & Trim([OndernomenActie]) & vbCrLf & vbCrLf
[DatumMailKarel] = Date
End If
If [Ronny] = True Then
ronnylogic = True
End If
rst.MoveNext
Loop
End If
rst.Close
Set rst = Nothing

"Salad" <oi*@vinegar.com> schreef in bericht
news:3F***************@vinegar.com...



Ronny Sigo wrote:

Hello all,
Could anybody give me the correct syntax for defining a loop using the
form''s recordset for as long as it is not at the end of the table ?

example:
Do While not EOF '' this is the part I don''t know
commands ....
.....
.....
Loop

Thanks .....



Dim rst As Recordset
Set rst = Currentdb.Openrecordset("MyTable",dbopendynaset)
If rst.Recordcount > 0 then
rst.MoveFirst
Do while not rst.EOF
....process
rst.MoveNext
Loop
Endif
rst.close
set rst = Nothing




这篇关于如何定义循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆