搜索&替换功能 [英] Search & Replace Function

查看:74
本文介绍了搜索&替换功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个搜索&在Access中替换功能。具体来说,我想搜索特定的SSN并替换它,如果找到的话。不确定如何编码胆量它的。以下是我到目前为止:


Private Sub CmdUpdateAppeal_Click()

SSNreplace = InputBox(请输入会员的SSN, ;更新SSN)

如果SSNreplace =""然后


MsgBox" No Number Entered。请再试一次,vbCritical,更新SSN


结束

结束如果


如果不是SSNreplace


如果MsgBox(这是正确的客户端吗?,vbYesNoCancel)<> vbYes然后

GoTo Flag1

结束如果

Else

MsgBox"抱歉,SSN NOT Found。请再试一次,vbCritical,更新SSN


结束如果


结束子


字段名称称为PersonID

I''m trying to create a search & replace function in Access. Specifically, I want to search for a specific SSN and replace it, if found. Not sure how to code the "guts" of it. Here is what I have so far:

Private Sub CmdUpdateAppeal_Click()
SSNreplace = InputBox("Please enter the Member''s SSN", "Update a SSN")
If SSNreplace = "" Then

MsgBox "No Number Entered. Please Try Again", vbCritical, "Update a SSN"

End
End If

If Not SSNreplace


If MsgBox("Is this the correct client?", vbYesNoCancel) <> vbYes Then
GoTo Flag1
End If
Else
MsgBox "Sorry, SSN NOT Found. Please Try Again", vbCritical, "Update a SSN"

End If

End Sub

The field name is called PersonID

推荐答案


我正在尝试创建搜索&在Access中替换功能。具体来说,我想搜索特定的SSN并替换它,如果找到的话。不确定如何编码胆量它的。以下是我到目前为止:


Private Sub CmdUpdateAppeal_Click()

SSNreplace = InputBox(请输入会员的SSN, ;更新SSN)

如果SSNreplace =""然后


MsgBox" No Number Entered。请再试一次,vbCritical,更新SSN


结束

结束如果


如果不是SSNreplace


如果MsgBox(这是正确的客户端吗?,vbYesNoCancel)<> vbYes然后

GoTo Flag1

结束如果

Else

MsgBox"抱歉,SSN NOT Found。请再试一次,vbCritical,更新SSN


结束如果


结束子


字段名称名为PersonID
I''m trying to create a search & replace function in Access. Specifically, I want to search for a specific SSN and replace it, if found. Not sure how to code the "guts" of it. Here is what I have so far:

Private Sub CmdUpdateAppeal_Click()
SSNreplace = InputBox("Please enter the Member''s SSN", "Update a SSN")
If SSNreplace = "" Then

MsgBox "No Number Entered. Please Try Again", vbCritical, "Update a SSN"

End
End If

If Not SSNreplace


If MsgBox("Is this the correct client?", vbYesNoCancel) <> vbYes Then
GoTo Flag1
End If
Else
MsgBox "Sorry, SSN NOT Found. Please Try Again", vbCritical, "Update a SSN"

End If

End Sub

The field name is called PersonID



您没有详细说明替换功能,但以下链接包含一个很好的分步和创建代码的代码搜索工具。

http://www.databasedev .co.uk / text_search.html



您没有详细说明替换功能,但以下链接包含一步一步的优秀代码和创建搜索工具的代码。

http://www.databasedev.co.uk/text_search.html



谢谢。我可以与它的搜索部分相关,它是替换部分我不确定....基本上,我想要做的是更新corressponding SSN,如果找到,更正版本....换句话说,用户将SSN输入到输入框中,如果找到,用户将有机会输入一个覆盖初始SSN的新SSN。


Thanks. I can relate to the search part of it, it''s the replace part I''m not sure about....Basically, what I will want to do is update the corressponding SSN, if found, with the a corrected version....in other words, the user will enter a SSN into the input box, if found, the user will then have the opportunity to input a new SSN that will over-write the intial one.


谢谢。我可以与它的搜索部分相关,它是替换部分我不确定....基本上,我想要做的是更新corressponding SSN,如果找到,更正版本....换句话说,用户将SSN输入到输入框中,如果找到,则用户将有机会输入将覆盖初始SSN的新SSN。
Thanks. I can relate to the search part of it, it''s the replace part I''m not sure about....Basically, what I will want to do is update the corressponding SSN, if found, with the a corrected version....in other words, the user will enter a SSN into the input box, if found, the user will then have the opportunity to input a new SSN that will over-write the intial one.



好​​的,你所描述的不是替换函数;你想要清除下一个条目的搜索控件(您的输入框)。这是通过将焦点设置在绑定控件PersonID并将输入框设置为空字符串(??)来完成的。代码包含在我给你的链接中。我已经摘录了清除输入框的代码部分(见下文),并试图通过使用与您正在使用的对象名称类似的对象名称使其更具相关性。您需要做的就是替换对象的实际名称

Ok, what you are describing is not a replace function; you want to "clear" the search control (your input box) for the next entry. This is done by setting focus on the bound control PersonID and setting the input box to an empty string (??). The code is contained in the link I gave you. I have excerpted the portion of the code that clears the input box (see below) and tried to make it more relevant by using object names similar to the ones you are using. All you need to do is substitute the actual name of your objects

展开 | 选择 | Wrap | 行号


这篇关于搜索&amp;替换功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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