Hi... newbee question...
Created a Acces-Database and a connection. I got the values of a row in a Combo. Furthermore 2 TextBoxes.
If I select a value from the Combo I want to have the value in a Text of the other row (the row next to) I hope u understand what I am trying te say.
Code for the connection I created:
Option Explicit
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
With cn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = _
"Data Source = C:\SEARCH.MDB;" & "Persist Security Info = False"
.Open
End With
Set rs = New ADODB.Recordset
With rs
.ActiveConnection = cn
.CursorLocation = adUseServer
.CursorType = adOpenDynamic
.Source = "Blad1"
.Open
End With
If Not rs.EOF And Not rs.BOF Then
rs.MoveFirst
Do While Not rs.EOF
Combo1.AddItem rs!Postcode
Combo2.AddItem rs!Plaats
rs.MoveNext
Loop
End If
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
End Sub
---------------------------------------
This will be the day when all of God’s children will be able to sing with a new meaning, “My country, ‘tis of thee, sweet land of liberty, of thee I sing. Land where my fathers died, land of the pilgrim’s pride, from every mountainside, let freedom ring. - Marten Luther King
Created a Acces-Database and a connection. I got the values of a row in a Combo. Furthermore 2 TextBoxes.
If I select a value from the Combo I want to have the value in a Text of the other row (the row next to) I hope u understand what I am trying te say.
Code for the connection I created:
Option Explicit
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
With cn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = _
"Data Source = C:\SEARCH.MDB;" & "Persist Security Info = False"
.Open
End With
Set rs = New ADODB.Recordset
With rs
.ActiveConnection = cn
.CursorLocation = adUseServer
.CursorType = adOpenDynamic
.Source = "Blad1"
.Open
End With
If Not rs.EOF And Not rs.BOF Then
rs.MoveFirst
Do While Not rs.EOF
Combo1.AddItem rs!Postcode
Combo2.AddItem rs!Plaats
rs.MoveNext
Loop
End If
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
End Sub
---------------------------------------
This will be the day when all of God’s children will be able to sing with a new meaning, “My country, ‘tis of thee, sweet land of liberty, of thee I sing. Land where my fathers died, land of the pilgrim’s pride, from every mountainside, let freedom ring. - Marten Luther King