VB 顺序弄不对了,,我弄糊涂了,帮忙看看!

来源:百度知道 编辑:UC知道 时间:2024/09/28 09:39:49
c = MsgBox("确定要初始化?这将清空所有数据!", vbYesNo)
If c = 6 Then
If Text1.Text = "8888" Then
adocn.Execute "delete * from asj"
adocn.Execute "delete * from bm"
adocn.Execute "delete * from zsj"
adocn.Execute "delete * from fl"
Else
MsgBox "无效的密码,请重试!", , "注意"
Exit Sub
End If

End If
你回答的跟我一样的啊。。、我是要这样:在text里输入密码,弹出确认框确认初始化,再校验密码是否正确,正确就初始化,不正确弹出密码不正确。再重新输入。

c = MsgBox("确定要初始化?这将清空所有数据!", vbYesNo)
If c = 6 Then '以下只有按YES时才有可能运行
If Text1.Text = "8888" Then '当你按YES且TEXT1文本为"8888"时运行
adocn.Execute "delete * from asj"
adocn.Execute "delete * from bm"
adocn.Execute "delete * from zsj"
adocn.Execute "delete * from fl"
Else '当你按YES且TEXT1文本不等于"8888"时运行
MsgBox "无效的密码,请重试!", , "注意"
Exit Sub
End If

End If

你的意思是要在确认初始化后才弹出输入的密码框?
If c = 6 Then
If Text1.Text = "8888" Then
之间加一句:(在form load时Text1.Visible=false)
If c = 6 Then
Text1.Visible =true
If Text1.Text = "8888" Then