成语大全网 - 成语词典 - 帮我用VB编写一个程序

帮我用VB编写一个程序

试试下面的方法,当你在Text1中输入后点按钮,则是英文查中文,如果你是在输入Text2后点按钮,则是中文查英文

Dim myText As TextBox

Private Sub Command1_Click()

Text1.Text = Adodc1.Recordset.Fields("English")

Text2.Text = Adodc1.Recordset.Fields("Chinese")

Adodc1.RecordSource = "Select * From 表1 Where " & myText.Tag & " LIKE '" & myText.Text & "%';"

Adodc1.Refresh

End Sub

Private Sub Text1_LostFocus()

Set myText = Text1

End Sub

Private Sub Text2_LostFocus()

Set myText = Text2

End Sub

Private Sub Form_Load()

Text1.Tag="English"

Text2.Tag="Chinese"

End Sub