I have a form called frmHotspots and dependant on which mainframe system table the user selects from a combo box above called ComboTable, I want the list box below called MyList to be populated with the field names of that system table. Each mainframe system table has its own table in my DB with 1 record in it just so that the field names can be picked up in the DB. For example if the user selects the table called TWA001_Transaction from the ComboTable field above i, I want the code to look within the DB find an Access table called TWA001_Transaction and populate Mylist listbox with the Access field names from that table:
i.e.
DBSERIAL_NUMBER
NO_OF_NARR_LINES (this is 2 of the field names in the table there are actually loads of fields in TWA001_transaction
I have attached the code which is a module called AddItemToEnd Currently the "select from" bit is hardcoded with TWA001_Transaction but this should be variable
In the OnCLick properties of Mylist listbox I have put the following code:
=AddItemToEnd([«ctrlListBox»],[«strItem»])
I'm obviously doing something majorly wrong as nothing happens when I click on Mylist
I then tried putting
=AddItemToEnd([«ctrlListBox»],[«strItem»])
into the Rowsource of the ListBox (with RowSourceType as Value List) but all this did is display =AddItemToEnd([«ctrlListBox»],[«strItem»]) as text in the ListBox
Any help from you clever people would be much appreciated
Thanks
Sam
i.e.
DBSERIAL_NUMBER
NO_OF_NARR_LINES (this is 2 of the field names in the table there are actually loads of fields in TWA001_transaction
I have attached the code which is a module called AddItemToEnd Currently the "select from" bit is hardcoded with TWA001_Transaction but this should be variable
In the OnCLick properties of Mylist listbox I have put the following code:
=AddItemToEnd([«ctrlListBox»],[«strItem»])
I'm obviously doing something majorly wrong as nothing happens when I click on Mylist
I then tried putting
=AddItemToEnd([«ctrlListBox»],[«strItem»])
into the Rowsource of the ListBox (with RowSourceType as Value List) but all this did is display =AddItemToEnd([«ctrlListBox»],[«strItem»]) as text in the ListBox
Any help from you clever people would be much appreciated
Thanks
Sam
Attachments
Last edited: