I have a workbook (dci database.xls) that is being used as an external database to the workbook (dci.xls) that I use frequently.
When I need to connect to the database, I have a userform that, when initialed, opens the database & set the rowsource for three comboboxes. See the code...
~~~~
Private Sub UserForm_Initialize()
saveedit.Visible = False
Application.DisplayAlerts = False
ChDir "crogram filesdci job folders"
Workbooks.Open Filename:="crogram filesdci job foldersDCI database.xls", UpdateLinks _
:=0
Windows("DCI database.xls").Activate
fablist.RowSource = "=fabdata!A2: A3000"
Englist.RowSource = "=engdata!A2: A3000"
Conlist.RowSource = "=condata!A2: A3000"
End Sub
~~~~~~~~~~
here's my problem, when I try to select data using any of the three comboboxes, I get a run-time error "could not get the column property. Invalid Argument". When the list drops down, the column of data is there, so it's 'soursed correctly, but after I make a selection, I get the run-time error. Here's the code for one of my combo's (all are about the same):
~~~~~~~~~~~~
Private Sub fablist_Change()
Sheets("fabdata").Activate
fabadd1.Value = fablist.Column(1)
fabadd2.Value = fablist.Column(2)
fabphone.Value = fablist.Column(3)
fabfax.Value = fablist.Column(4)
fabcon.Value = fablist.Column(5)
fabemail.Value = fablist.Column(6)
End Sub
~~~~~~~~~~~~~~
The database workbook is still active, so it should be working, but it's not. Any advice about my problem??
When I need to connect to the database, I have a userform that, when initialed, opens the database & set the rowsource for three comboboxes. See the code...
~~~~
Private Sub UserForm_Initialize()
saveedit.Visible = False
Application.DisplayAlerts = False
ChDir "crogram filesdci job folders"
Workbooks.Open Filename:="crogram filesdci job foldersDCI database.xls", UpdateLinks _
:=0
Windows("DCI database.xls").Activate
fablist.RowSource = "=fabdata!A2: A3000"
Englist.RowSource = "=engdata!A2: A3000"
Conlist.RowSource = "=condata!A2: A3000"
End Sub
~~~~~~~~~~
here's my problem, when I try to select data using any of the three comboboxes, I get a run-time error "could not get the column property. Invalid Argument". When the list drops down, the column of data is there, so it's 'soursed correctly, but after I make a selection, I get the run-time error. Here's the code for one of my combo's (all are about the same):
~~~~~~~~~~~~
Private Sub fablist_Change()
Sheets("fabdata").Activate
fabadd1.Value = fablist.Column(1)
fabadd2.Value = fablist.Column(2)
fabphone.Value = fablist.Column(3)
fabfax.Value = fablist.Column(4)
fabcon.Value = fablist.Column(5)
fabemail.Value = fablist.Column(6)
End Sub
~~~~~~~~~~~~~~
The database workbook is still active, so it should be working, but it's not. Any advice about my problem??