密码表格 [英] Password Form

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

问题描述

嗨ppl。

我做了一个名为frmPassword的表格。当有人点击删除按钮时,它会打开。该表单有两个textobox和两个按钮。 txtCod是不可见的,密码存储在哪里。 txtPassword用户输入密码的位置。 btnOk按钮确认密码。 btn取消并取消并返回上一个表格而不删除任何内容。


问题是:我必须在btnOk上使用什么代码?我希望它检查txtPassword是否具有与txtCod中相同的值。如果它们相同,则触发删除按钮onclick事件。如果它们不相同,我希望它显示msgbox sayng错误,错误传递。 msgbox我知道怎么做,但我不知道如何触发删除按钮...


帮助赞赏,Slaxer13

Hi ppl.
I did a form called frmPassword. It opens when someone clicks the delete button. That form has two textoboxes and two buttons. txtCod which is invisible and where the password is stored. txtPassword where the user enters the password. btnOk button to confirm the password. btnCancel to cancel and return to the previous form without deleting anything.

The question is: what is the code that i must use on the btnOk? I want it to check if the txtPassword has the same value as in the txtCod. If they are the same it triggers the delete button onclick event. if they are not the same i want it to display a msgbox sayng "error, wrong pass". the msgbox i know how to do but i don''t know how to trigger the delete button...

Help appreciated, Slaxer13

推荐答案

slaxer,

请记住,您的删除按钮会触发密码验证。这是关键。在Main表单中创建另一个公共函数或Sub,它实际上删除了记录。可以这么简单:

slaxer,

Remember, your delete button triggers the password authentication. That is the key. Create another Public Function or Sub in the Main form which actually deletes the record. Could be as simple as:

展开 | 选择 | Wrap | 行号


这是一个完美的答案。但是 - 考虑一种可以使您的工作更轻松的替代方法。
That''s a perfect answer. However - consider an alternative approach which should make your job easier.
  1. 在您的cmdDelete代码中有类似的内容:
  1. In your cmdDelete code have something like :
展开 | 选择 | Wrap | 行号


简单方法!使用OnOpenEvent。当然,您可以根据自己的喜好更改消息和密码。

Easy Way! Using OnOpenEvent. Of course, you can change the Msg and Password to your liking.

展开 | 选择 | Wrap | 行号


这篇关于密码表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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