Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Aug 2006
    Location
    Capital Federal, Argentina
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Change Column Name (2k)

    Hi all,

    I used a Stored Procedure (SQL Server 2000) to define the RowSource of a ListBox.

    i.e.
    <code>
    ListBox.RowSource = "EXEC STORED_PROCEDURE_NAME " & var1 & ", " & var2
    </code>


    How can I change columns' names of that ListBox?

    Thanx,

    Mat&

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Change Column Name (2k)

    Do you mean the column headings that are displayed if the ColumnHeadings property of the list box is set to True? Access uses the field names from the row source, so if you want different column headings, you must change the field names (or their aliases) in the row source. There is no way to change the column headings without changing the row source.

  3. #3
    New Lounger
    Join Date
    Aug 2006
    Location
    Capital Federal, Argentina
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change Column Name (2k)

    Yes, I meant that. The problem is that I can't change the aliases because they are going to change when the value of a ComboBox changes... and I can't use a variable for those aliases in a Stored Procedure.
    I think a solution may be setting the ColumnHeadings property False and use labels instead of headings.

    What do you think?

    Thanks,

    Mat&

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Change Column Name (2k)

    I think that would be a better way to do it. You can change the caption of the labels using code in the After Update event of the combo box.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •