I like to connect some tables stored in an MS Access database to textboxes, checkboxes and comboboxes. Connecting the main information (first table) in the database, which is related to entries in a combobox (second table) works well, but how can I bind a third table to a textbox, updating with the others when clicking the next or previous button? When using the next or previous button the dataset should change in all textboxes. How is the code to realize this? The same problem I have with checkboxes. How is the code binding yes/no data from a fourth table to checkboxes in the GUI?
MANY, MANY THANKS FOR YOUR HELP !!!
with regards
Hermann
Private Sub Form_Load()
Set eventhandler = New dBEvent 'eventhandler is a class module
Set bindCol = New BindingCollection
'Binding the main recordset to a textbox
With bindCol
Set .DataSource = eventhandler.rstStructuralIndicator
.Add txtStrucShortName(0), "Text", "struc_short_name"
.Add txtStrucFullName(0), "Text", "struc_full_name"
End With
'Binding a DataCombo to the main recordset
With dbcCategory
Set .DataSource = eventhandler
.DataMember = "STRUCTURAL_INDICATOR"
.DataField = "struc_indicator_id" 'Der Bezug zum Primärschlüssel
.RowMember = "INDICATOR_CATEGORY"
Set .RowSource = eventhandler 'this is a class module
.BoundColumn = "struc_category_id"
.ListField = "category"
End With
a) HOW TO REALISE TO CONNECT A THIRD TABELE IN THE DATABASE TO A CHECKBOX? IS THE CODE FOR OPTIONBUTTONS THE SAME?
b) HOW TO REALISE TO CONNECT ANOTHER SECOND TEXTBOX WITH DATA FROM A FOURTH TABLE IN THE DATABASE?
End Sub
MANY, MANY THANKS FOR YOUR HELP !!!
with regards
Hermann
Private Sub Form_Load()
Set eventhandler = New dBEvent 'eventhandler is a class module
Set bindCol = New BindingCollection
'Binding the main recordset to a textbox
With bindCol
Set .DataSource = eventhandler.rstStructuralIndicator
.Add txtStrucShortName(0), "Text", "struc_short_name"
.Add txtStrucFullName(0), "Text", "struc_full_name"
End With
'Binding a DataCombo to the main recordset
With dbcCategory
Set .DataSource = eventhandler
.DataMember = "STRUCTURAL_INDICATOR"
.DataField = "struc_indicator_id" 'Der Bezug zum Primärschlüssel
.RowMember = "INDICATOR_CATEGORY"
Set .RowSource = eventhandler 'this is a class module
.BoundColumn = "struc_category_id"
.ListField = "category"
End With
a) HOW TO REALISE TO CONNECT A THIRD TABELE IN THE DATABASE TO A CHECKBOX? IS THE CODE FOR OPTIONBUTTONS THE SAME?
b) HOW TO REALISE TO CONNECT ANOTHER SECOND TEXTBOX WITH DATA FROM A FOURTH TABLE IN THE DATABASE?
End Sub