想做一个,点开窗体户名的下拉列表,自动在账号的文本框中回显1234567.
原来学过一点,时间长了想做个东西发现好多都忘记了.
Private Sub Combo15_Change()
Dim Conn As New ADODB.Connection
Dim Rst As New ADODB.Recordset
Set Conn = CurrentProject.Connection
Rst.Open "select 账号 from 密码器 where 户名='" & "中铁六局'", Conn, 1, 3这后面就不会写了
End Sub
好吧,我知道自己问的太简单,即使老师直接给答案我也会自已把它弄懂的.
经过在论坛泡了一上午感觉正在缓慢的回血.哈哈
Private Sub Combo15_Change()
Dim Conn As New ADODB.Connection
Dim Rst As New ADODB.Recordset
Set Conn = CurrentProject.Connection
Rst.Open "select 账号 from 密码器 where 户名='" & Combo15 & "'", Conn, 1, 3
账号 = Rst!账号
Rst.Close
End Sub