Hi., every one.
I want to know , how to write code for pickup data from access database to my form using combobox and display all data into textbox, follow the combobox selection.
i'am using 1 combox and 32 textbox
all data must display in textbox when i select (change) at combobox ( by company names )
my example programs :
_____________________________
Option Explicit
Dim DB As Database
Dim RS As Recordset
Dim Data As String
________________________
Private Sub Form_Load()
CustData.DatabaseName = App.Path & "\CIS Database.mdb"
CustData.RecordSource = "CISData"
Set DB = OpenDatabase(App.Path & "\CIS Database.mdb") 'Open database
Set RS = DB.OpenRecordset("SELECT * FROM CISData") ' ORDER BY Company") 'Choose the table
Do While RS.EOF <> True 'add all the items in combobox
Combo1.AddItem RS(2) '& ""
RS.MoveNext
Loop
Label11.Caption = frmLogin.txtUserName
Label13.Caption = Date
Label13.Caption = Format(Date, "dd MMMM yyyy")
End sub
_____________________________
Private Sub Combo1_Click()
On Error Resume Next
What coding i must write here...?
please help...
thanks.
Enter your message below
Sign in or Join us (it's free).