• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Error trying to set table as rowsource ( SOLVED )

rjchristensen

New Member
Hello all,

I have been trying to get a selected table name from one listbox and make it the rowsource of a second listbox. When I click on a value in the first listbox, I get the following error message:

Run-time Error '380'
Could not set the rowsource property. Invalid property value.

The code is as follows:

>>> use code - tags <<<
Code:
Private Sub lbxTableList_Click()
    Dim strTableName As String
    If lbxTableList.ListCount <> -1 Then
        strTableName = "LU" & Trim(lbxTableList.Value)
        lbxTableValues.RowSource = strTableName
    End If
End Sub
When viewed via the debugger the variable strTableName value is shown as <Expression not defined in context>

Any help here would be greatly appeciated

TIA

Rich
 
Last edited by a moderator:
rjchristensen
Moved Your Ask an Excel Question to VBA Macros.
Please reread Forum Rules
 
rjchristensen
Moved Your Ask an Excel Question to VBA Macros.
Please reread Forum Rules


Thanks!

It's not showing up in the VBA Macros forum yet. Does this usually take time to happen?
 
(Solved) - Bad data in lookup table
Hello all,

I have been trying to get a selected table name from one listbox and make it the rowsource of a second listbox. When I click on a value in the first listbox, I get the following error message:

Run-time Error '380'
Could not set the rowsource property. Invalid property value.

The code is as follows:

>>> use code - tags <<<
Code:
Private Sub lbxTableList_Click()
    Dim strTableName As String
    If lbxTableList.ListCount <> -1 Then
        strTableName = "LU" & Trim(lbxTableList.Value)
        lbxTableValues.RowSource = strTableName
    End If
End Sub
When viewed via the debugger the variable strTableName value is shown as <Expression not defined in context>

Any help here would be greatly appeciated

TIA

Rich
 
Back
Top