无法让Echo工作 [英] Can't Get Echo To Work

查看:65
本文介绍了无法让Echo工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要暂时从我的表单中删除记录集,同时运行一些

查询(有锁定问题)。所以我在删除

记录集之前关闭了Echo以避免获取#Name?在绑定控件中。然而,即使我把Echo关掉了,我还是得到#Name?直到我重置

记录集。这是我正在使用的代码:


DoCmd.Hourglass True

Application.Echo False

我。 RecordSource =""

<在这里运行查询>

< reset recordsource here>


我还有什么我在这做错了吗? (我也尝试过DoCmd.Echo False,甚至

虽然OLH建议使用Application.Echo。)


谢谢,


Neil

I need to temporarily remove the recordset from my form while I run some
queries (have locking problems). So I turned Echo off before removing the
recordset to avoid getting #Name? in the bound controls. However, even
though I turned Echo off, I''m still getting #Name? until I reset the
recordset. Here''s the code I''m using:

DoCmd.Hourglass True
Application.Echo False
Me.RecordSource = ""
<run queries here>
<reset recordsource here>

Anything I''m doing wrong here? (I''ve also tried DoCmd.Echo False, even
though OLH recommends using Application.Echo.)

Thanks,

Neil

推荐答案

不要删除记录集,只需强制保存或撤消:

如果Me.Dirty然后

Me.Dirty = False''Me.Undo

结束如果

这应解决锁定问题。


-

Allen Browne - 微软MVP。西澳大利亚州珀斯。

访问用户提示 - http:// allenbrowne.com/tips.html

回复群组,而不是mvps dot org的allenbrowne。


" Neil" <无**** @ nospam.net>在留言中写道

news:cU *************** @ newsread1.news.pas.earthlin k.net ...
Instead of removing the recordset, just force a save or undo:
If Me.Dirty Then
Me.Dirty = False '' Me.Undo
End If
That should solve the locking problem.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Neil" <no****@nospam.net> wrote in message
news:cU***************@newsread1.news.pas.earthlin k.net...
当我运行一些
查询(有锁定问题)时,我需要暂时从表单中删除记录集。所以我在删除
记录集之前关闭了Echo以避免获取#Name?在绑定控件中。然而,即使我把Echo关掉了,我还是得到#Name?直到我重置
记录集。这是我正在使用的代码:

DoCmd.Hourglass True
Application.Echo False
Me.RecordSource =""
<在这里运行查询>
<在这里重置记录源>

我在这里做错了什么? (我也试过DoCmd.Echo False,甚至
虽然OLH建议使用Application.Echo。)

谢谢,

Neil
I need to temporarily remove the recordset from my form while I run some
queries (have locking problems). So I turned Echo off before removing the
recordset to avoid getting #Name? in the bound controls. However, even
though I turned Echo off, I''m still getting #Name? until I reset the
recordset. Here''s the code I''m using:

DoCmd.Hourglass True
Application.Echo False
Me.RecordSource = ""
<run queries here>
<reset recordsource here>

Anything I''m doing wrong here? (I''ve also tried DoCmd.Echo False, even
though OLH recommends using Application.Echo.)

Thanks,

Neil



不,它不会。我在运行查询之前做了保存,但无济于事。

这些是作为传递执行的SQL查询,并且由于某种原因,这个表单,

这是一个表格和子表格,正在锁定桌子而不是允许SP运行的



所以,回到这种情况, Echo应该冻结屏幕更新,并且在Echo = False之后删除记录集不应该导致任何更新。

我似乎记得在过去使用它方式效果很好。但是由于某些原因,
无法使用它。


Neil

" Allen Browne" <铝********* @ SeeSig.Invalid>在消息中写道

news:%2 **************** @ tk2msftngp13.phx.gbl ...
No, it won''t. I do do a save before running my queries, but to no avail.
These are SQL queries run as pass-throughs, and, for some reason, this form,
which is a form and a subform, is putting a lock on the table and not
allowing the SPs to run.

So, back to this situation, Echo is supposed to freeze screen updating, and
removing the recordset after Echo = False should not result in any updating.
And I seem to remember using it in the past this way with good results. But
can''t get this to work for some reason.

Neil
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
而不是删除记录集,只需强制保存或撤消:
如果Me.Dirty那么
Me.Dirty = False''Me.Undo
结束如果
这应解决锁定问题。

-
Allen Browne - 微软MVP。西澳大利亚州珀斯。
访问用户提示 - http://allenbrowne.com/ tips.html
回复群组,而不是mvps dot org的allenbrowne。

Neil <无**** @ nospam.net>在消息中写道
新闻:cU *************** @ newsread1.news.pas.earthlin k.net ...
Instead of removing the recordset, just force a save or undo:
If Me.Dirty Then
Me.Dirty = False '' Me.Undo
End If
That should solve the locking problem.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Neil" <no****@nospam.net> wrote in message
news:cU***************@newsread1.news.pas.earthlin k.net...
我需要当我运行一些
查询(有锁定问题)时,暂时从我的表单中删除记录集。所以我在删除
记录集之前关闭了Echo以避免获取#Name?在绑定控件中。然而,即使我把Echo关掉了,我还是得到#Name?直到我重置
记录集。这是我正在使用的代码:

DoCmd.Hourglass True
Application.Echo False
Me.RecordSource =""
<在这里运行查询>
<在这里重置记录源>

我在这里做错了什么? (我也试过DoCmd.Echo False,甚至
虽然OLH建议使用Application.Echo。)

谢谢,

Neil
I need to temporarily remove the recordset from my form while I run some
queries (have locking problems). So I turned Echo off before removing the
recordset to avoid getting #Name? in the bound controls. However, even
though I turned Echo off, I''m still getting #Name? until I reset the
recordset. Here''s the code I''m using:

DoCmd.Hourglass True
Application.Echo False
Me.RecordSource = ""
<run queries here>
<reset recordsource here>

Anything I''m doing wrong here? (I''ve also tried DoCmd.Echo False, even
though OLH recommends using Application.Echo.)

Thanks,

Neil




Neil写道:
当我运行一些
查询(有锁定问题)。所以我在删除
记录集之前关闭了Echo以避免获取#Name?在绑定控件中。然而,即使我把Echo关掉了,我还是得到#Name?直到我重置
记录集。这是我正在使用的代码:

DoCmd.Hourglass True
Application.Echo False
Me.RecordSource =""
<在这里运行查询>
<在这里重置记录源>

我在这里做错了什么? (我也尝试过DoCmd.Echo False,甚至
虽然OLH建议使用Application.Echo。)

谢谢,

Neil
I need to temporarily remove the recordset from my form while I run some
queries (have locking problems). So I turned Echo off before removing the
recordset to avoid getting #Name? in the bound controls. However, even
though I turned Echo off, I''m still getting #Name? until I reset the
recordset. Here''s the code I''m using:

DoCmd.Hourglass True
Application.Echo False
Me.RecordSource = ""
<run queries here>
<reset recordsource here>

Anything I''m doing wrong here? (I''ve also tried DoCmd.Echo False, even
though OLH recommends using Application.Echo.)

Thanks,

Neil




Echo仅指状态栏文本AFAIK。


代码(在我的sig下面)来自测试表格一些文本框和两个

按钮(_click程序中的按钮名称)。你应该能够根据自己的需要调整

,基本上它会保存

控件的所有控制源,以便解开表单,第二个按钮将它们全部放回去/>
再次开启。


-

[OO = 00 = OO]

期权比较数据库

选项明确


Dim mstrRecordSource As String

Dim mstrCtlSrc()As String


Private Sub Form_Open(取消为整数)

mstrRecordSource = Me.RecordSource

End Sub

Private Sub cmdUnBound_Click()

Dim i As Long

ReDim mstrCtlSrc(Me.Controls.Count)


On Error Resume Next

''导致其中一些WILL错误除非你

''检查他们的类型等,啰嗦

For i = 0 To Me.Controls.Count - 1

mstrCtlSrc(i)= Me.Controls(i).ControlSource

Me.Controls(i).ControlSource =""

Next

Me.RecordSource =&quo t;


结束子


私人子cmdBound_Click()

Dim i As Long


On Error Resume Next

Me.RecordSource = mstrRecordSource

For i = 0 To Me.Controls.Count - 1

Me.Controls(i).ControlSource = mstrCtlSrc(i)

下一页

结束子



Echo only refers to the status bar text AFAIK.

The code (below my sig) is from a test form with a few textboxes and two
buttons (button names in _click procedures). You should be able to adapt
that to your needs, basically it saves all the controlsources of the
controls befor unbinding the form, the second button puts them all back
on again.

--
[OO=00=OO]
Option Compare Database
Option Explicit

Dim mstrRecordSource As String
Dim mstrCtlSrc() As String

Private Sub Form_Open(Cancel As Integer)
mstrRecordSource = Me.RecordSource
End Sub
Private Sub cmdUnBound_Click()
Dim i As Long
ReDim mstrCtlSrc(Me.Controls.Count)

On Error Resume Next
'' cause some of these WILL error unless you
'' check their type, etc, long winded
For i = 0 To Me.Controls.Count - 1
mstrCtlSrc(i) = Me.Controls(i).ControlSource
Me.Controls(i).ControlSource = ""
Next
Me.RecordSource = ""

End Sub

Private Sub cmdBound_Click()
Dim i As Long

On Error Resume Next
Me.RecordSource = mstrRecordSource
For i = 0 To Me.Controls.Count - 1
Me.Controls(i).ControlSource = mstrCtlSrc(i)
Next
End Sub


这篇关于无法让Echo工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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