# Re: 请教一个vb问题...谢谢!!

Posted by Honey on August 22, 1998 at 16:44:13:

In Reply to: 请教一个vb问题...谢谢!! posted by Gary on August 22, 1998 at 14:23:19:

最简单的方式是
在 '一般宣告' 中宣告
Dim cre As Long
或在 '一般模组' 宣告
Public cre as long

: Private Sub Option1_Click()
: Dim cre As Long

: Dim bkm As Variant
: On Error GoTo ed

: bkm = data1.Recordset.Bookmark
: cre = InputBox$("请输入欲查询编号:", "查询")

:
: data1.Recordset.FindFirst "编号 =" & cre

: If data1.Recordset.NoMatch Then
: data1.Recordset.Bookmark = bkm
: Call worng
: Command2.Enabled = False
: Com2.Enabled = True
: Else
: Command2.Enabled = True
: Com2.Enabled = False
: End If

: ed:
: End Sub

: ===========================

: Private Sub Command2_Click()

:
: data1.Recordset.FindNext "编号 =" & cre
: If data1.Recordset.NoMatch Then
: MsgBox "己经没有'" & cre & "'的客户资料!", vbOKOnly, "搜寻资料"
: Command2.Enabled = False
: Com2.Enabled = True
: Else
: Command2.Enabled = True
: Com2.Enabled = False
: End If

: End Sub

:
: 以上是我的程式:请问command2 要如何取得 option1 中 cre 的值呢??

: ~~ 麻烦一下...谢谢.. vb白痴留... ^.^"

Follow Ups: