Results 1 to 3 of 3
  1. #1
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591

    Storing an object in a table

    I have a table of report names, each of which contain at least one chart. These populate a combo box on my form. There are several other properties, like the Report ID, Access report name, underlying query and the name of the chart object. I have a Select Case statement that sets an object variable to the chart object.



    Code:
         Select Case intReport
            Case 1
                                Set chrt = Reports!MyReport!grph_1
            Case 2
                                Set chrt = Reports!MyReport!grph_2
            Case 3
                                Set chrt = Reports!MyReport!grph_3
    The code above works. What I would like it to do is select the chart from the column in my combo box that has that chart name, like this.

    Code:
        Set chrt = Forms!frm_Chart!cboReports.Column(7)
    The problem is that this is stored as text and the Set statement requires an object. Is there any way I can convert my string into an object?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,641
    The combobox is a variable. Use parens with variables. Like:

    Reports!MyReport(Forms!frmChart!cboReports.Column( 7))
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    Thanks, that was a new one. Worked like a charm!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 08-09-2013, 12:04 AM
  2. Replies: 11
    Last Post: 06-02-2013, 10:42 PM
  3. Storing code in a table
    By jgelpi16 in forum Programming
    Replies: 4
    Last Post: 07-27-2011, 07:22 PM
  4. Storing information from combobox in table
    By michaelb in forum Forms
    Replies: 4
    Last Post: 05-04-2011, 09:42 AM
  5. Storing an Equation in Table
    By tmedler in forum Programming
    Replies: 0
    Last Post: 03-09-2009, 09:25 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums