帮助自动EXE编程/代码 [英] HELP WITH AUTO EXE PROGRAMMING/CODE

查看:65
本文介绍了帮助自动EXE编程/代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计们,


请原谅我,如果我的问题是我的愚蠢,但我会非常感激,并且可以提供帮助!

我的情况如下:


我创建了一个Button,并将其设置为'On Click"活动进行到

循环浏览我的数据库,找到任何记录属于

某些日期...如果找到记录......然后通过电子邮件发送给我记录

已找到,并告诉我检查数据库....


现在....我想完全自动化这个过程.. .as数据库是

并不总是每天使用......甚至每周......我希望
因此确保这个过程至少每周执行一次
,是否有某种方式我可以实现这个......请指教!


我明白我可以设置和自动执行进程来打开

数据库...但是如何编程数据库以运行?单击

事件继续包含此代码...我是否必须将其设置为

moduel ...并创建一个宏来运行数据库时执行或

什么?

解决方案

我的情况如下:

我创建了一个Button,并将其设置为'On Click"事件继续到我的数据库循环并查找属于某个日期的任何记录...如果找到记录...它然后通过电子邮件发送我已发现的记录
并告诉我检查数据库....

现在....我想完全自动化这个过程...因为数据库并不总是使用...每天,甚至每周.....我想确保这个过程至少每周执行一次,是否有某种方式可以实现
这.....请指教!

我明白我可以设置和自动执行程序来打开
数据库...但我怎么编程数据库运行点击
事件继续包含此代码...我是否必须将其设置为
moduel ...并创建一个宏来执行数据库时运行或
什么?




循环数据库?你的意思是你正在运行一个查询,对吗?

否则,你正在做的事情比他们应该做的更难。打开

a记录集,根据查询找到你想要的记录和

在循环内处理。


你会的必须运行调度程序来执行类似于您的建议。我认为在 www.mvps上有一个代码。组织/访问此处...
http ://www.mvps.org/access/modules/mdl0042.htm


是的,请在按钮的点击事件中调用该事件。你可以

创建一个执行RunCode调用的宏,然后离开。


谢谢你这么快的回复。 ..yes我有查询设置...

查询'基于DueDate的数据库字段...如果任何记录在DueDate的2个月内落下

然后这段代码执行另一个

命令SendMail..它通过电子邮件告诉我检查

数据库....


我还没有看到你提供给我的那些链接...希望他们

可以工作......

我的查询如下:

Dim rst as Object

Set rst = Me.Recordset.Clone

rst

.MoveFirst

Do While Not .EOF

If .Fields(" Due Date")> = VBA.Date和_

.Fields(" Due Date" )< = DateAdd(" m",2,VBA.Date)+ 1

然后

SendMail(" ga ********* ***@hotmail.com")

结束如果

.MoveNext

循环

结束

End Sub


显然这会提示SendMail。代码.....你知道我怎么样?b $ b也可以......如果找到了一条记录......将这个

记录中的其他字段传递给了;我的电子邮件??????????

pietlin ... @ hotmail.com写道:

我的情况如下:

我创建了一个Button,并将其设置为On Click。事件继续到我的数据库循环并查找属于某个日期的任何记录...如果找到记录...它然后通过电子邮件发送我已发现的记录
并告诉我检查数据库....

现在....我想完全自动化这个过程...因为数据库并不总是使用...每天,甚至每周.....我想确保这个过程至少每周执行一次,是否有某种方式可以实现
这.....请指教!

我明白我可以设置和自动执行程序来打开
数据库...但我怎么编程数据库运行点击
事件继续包含此代码...我是否必须将其设置为
moduel ...并创建一个宏来执行数据库时运行或
什么?



循环数据库?你的意思是你正在运行一个查询,对吧?
否则,你正在制造比它们更难的东西。打开基于查询的记录集,该查询找到您想要的记录并在循环内处理。

您必须运行调度程序来执行类似于您的操作提出。我想在 www.mvps.org/access <上有一个代码。 / a>这里......
http:// www .mvps.org / access / modules / mdl0042.htm

是的,请在按钮的点击事件中调用该事件。您可以创建一个执行RunCode调用的宏,然后离开。





Li **** @ awamarine.com.au 写道:

谢谢你这么快的回复.. .yes我有查询设置......
基于DueDate查询数据库。 field ...如果任何记录在DueDate的2个月内落下。然后这段代码执行另一个
命令SendMail..它通过电子邮件告诉我检查数据库....

我还没看看那些链接你已经提供了...希望他们能够工作......
我的查询如下:
Dim's As Object

Set rst = Me.Recordset。克隆

rst
.MoveFirst
不要.EOF
如果.Fields(截止日期)> = VBA.Date和_
.Fields(" Due Date")< = DateAdd(" m",2,VBA.Date)+ 1
然后
SendMail(" ga ******* *****@hotmail.com")
结束如果
.MoveNext
循环
结束

结束子
记录中的其他字段传递给我的电子邮件????????????????????????????????????????????????????????????????????????????????????????????甚至不想看?然后你可以完全废弃IF ..END

IF测试,因为它将在查询中。基本上你会将过滤器移动到查询并完成它。然后你可以使用

发送电子邮件。

http://www.amazecreations.com/datafa...utlookMail.asp

Hey guys,

Forgive me if my question my be alittle silly, but I would very much
appreciate and assistance that could be given!

My situation is as follows:

I have created a Button, and set it''s "On Click" Event proceedure to
Loop through my Database and find any records that fall within a
Certain Date...if a record is found...it then emails me that a record
has been found and tells me to check the Database....

Now....I would like to fully automate this process...as the database is
not always used...on a daily basis or even on a weekly basis..... and I
would therefore like to ensure that this process is at least performed
on a weekly basis, is there some manner in which I can achieve
this.....please advise!

I understand that I can set-up and auto-exe process to open the
database...but how can I programme the database to "run" the on click
event proceedure that contains this code...do I have to set it as a
moduel...and create a macro to run when the database is executed or
what?

解决方案

My situation is as follows:

I have created a Button, and set it''s "On Click" Event proceedure to
Loop through my Database and find any records that fall within a
Certain Date...if a record is found...it then emails me that a record
has been found and tells me to check the Database....

Now....I would like to fully automate this process...as the database is
not always used...on a daily basis or even on a weekly basis..... and I
would therefore like to ensure that this process is at least performed
on a weekly basis, is there some manner in which I can achieve
this.....please advise!

I understand that I can set-up and auto-exe process to open the
database...but how can I programme the database to "run" the on click
event proceedure that contains this code...do I have to set it as a
moduel...and create a macro to run when the database is executed or
what?



Loop through the database? You mean you''re running a query, right?
Otherwise, you''re making things MUCH harder than they should be. Open
a recordset based on a query that finds the records you want and
process inside a loop.

You''d have to run a scheduler to do something like what you propose. I
think there''s code for one at www.mvps.org/access here...
http://www.mvps.org/access/modules/mdl0042.htm

Yes, call the event in the on click event of your button. You can
create a macro that does a RunCode call, and away you go.


Thankyou for such a speedy reply...yes I have query set up...that
query''s the database based on a "DueDate" field...if any Record falls
within a 2month period of the "DueDate" then this code executes another
command "SendMail"..which emails me telling me to check the
database....

I have yet to look at those links you have provided me...hopefully they
shall work...
My query is as follows:
Dim rst As Object
Set rst = Me.Recordset.Clone
With rst
.MoveFirst
Do While Not .EOF
If .Fields("Due Date") >= VBA.Date And _
.Fields("Due Date") <= DateAdd("m", 2, VBA.Date) + 1
Then
SendMail ("ga************@hotmail.com")
End If
.MoveNext
Loop
End With
End Sub

Obviously this then prompts the "SendMail" code.....do u know how I
could also...if a record is found...pass some other fields from this
record "into" my Email??????????

pietlin...@hotmail.com wrote:

My situation is as follows:

I have created a Button, and set it''s "On Click" Event proceedure to
Loop through my Database and find any records that fall within a
Certain Date...if a record is found...it then emails me that a record
has been found and tells me to check the Database....

Now....I would like to fully automate this process...as the database is
not always used...on a daily basis or even on a weekly basis..... and I
would therefore like to ensure that this process is at least performed
on a weekly basis, is there some manner in which I can achieve
this.....please advise!

I understand that I can set-up and auto-exe process to open the
database...but how can I programme the database to "run" the on click
event proceedure that contains this code...do I have to set it as a
moduel...and create a macro to run when the database is executed or
what?



Loop through the database? You mean you''re running a query, right?
Otherwise, you''re making things MUCH harder than they should be. Open
a recordset based on a query that finds the records you want and
process inside a loop.

You''d have to run a scheduler to do something like what you propose. I
think there''s code for one at www.mvps.org/access here...
http://www.mvps.org/access/modules/mdl0042.htm

Yes, call the event in the on click event of your button. You can
create a macro that does a RunCode call, and away you go.





Li****@awamarine.com.au wrote:

Thankyou for such a speedy reply...yes I have query set up...that
query''s the database based on a "DueDate" field...if any Record falls
within a 2month period of the "DueDate" then this code executes another
command "SendMail"..which emails me telling me to check the
database....

I have yet to look at those links you have provided me...hopefully they
shall work...
My query is as follows:
Dim rst As Object
Set rst = Me.Recordset.Clone
With rst
.MoveFirst
Do While Not .EOF
If .Fields("Due Date") >= VBA.Date And _
.Fields("Due Date") <= DateAdd("m", 2, VBA.Date) + 1
Then
SendMail ("ga************@hotmail.com")
End If
.MoveNext
Loop
End With
End Sub

Obviously this then prompts the "SendMail" code.....do u know how I
could also...if a record is found...pass some other fields from this
record "into" my Email??????????


Again, why are you not just opening a query to filter out all the
records you don''t even want to look at? Then you can scrap the IF..END
IF test completely, as that will be in the query. Basically you''d move
the filter to the query and be done with it. Then you could use
something like this to send the e-mail.

http://www.amazecreations.com/datafa...utlookMail.asp


这篇关于帮助自动EXE编程/代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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