Results 1 to 3 of 3
  1. #1
    f15e is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2016
    Posts
    71

    Problem with commas in string array

    There is probably a simple solution but I've looked online and found everything BUT what I need. I have a string array as shown below and when I output 'tbls_array(7, 1)' and 'tbls_array(10, 1),', the string is cutoff at the first comma. I realize that it's cutting off due to the comma delimitation, but I don't want that. I want to output the string in tact with commas in it.

    How would I go about doing this?

    '************************************************* **
    Dim tbls_array(11, 2) As Variant

    tbls_array(0, 0) = "Areas_Tbl"
    tbls_array(0, 1) = "Project Facility Areas"
    tbls_array(1, 0) = "Bridge_Gross_Wt_Hist_Tbl"
    tbls_array(1, 1) = "Revision history of Bridge gross weights"
    tbls_array(2, 0) = "Contingency_Tbl"
    tbls_array(2, 1) = "List of Project Contingencies"
    tbls_array(3, 0) = "DisciplineList_Tbl"
    tbls_array(3, 1) = "List of Disciplines whose weight data is relevant to WCR"
    tbls_array(4, 0) = "Flareboom_Gross_Wt_Hist_Tbl"
    tbls_array(4, 1) = "Revision history of Flareboom gross weights"
    tbls_array(5, 0) = "Jacket_Gross_Wt_Hist_Tbl"
    tbls_array(5, 1) = "Revision history of Jacket gross weights"
    tbls_array(6, 0) = "Piles_Gross_Wt_Hist_Tbl"
    tbls_array(6, 1) = "Revision history of Piles gross weights"
    tbls_array(7, 0) = "Proj_ID_Data_Tbl"
    tbls_array(7, 1) = "Project Information (Client, Proj. Name, Proj. Number, etc.)"
    tbls_array(8, 0) = "TimeCodes_Tbl"
    tbls_array(8, 1) = "Time Codes and Descriptions"
    tbls_array(9, 0) = "Topsides_Gross_Wt_Hist_Tbl"


    tbls_array(9, 1) = "Revision history of Topside gross weights"
    tbls_array(10, 0) = "Weight_Data_Tbl"
    tbls_array(10, 1) = "WCR Database Main Data Table (Weights, Coordinates, etc.)"

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    probably something to do with the way you are trying to output it. So how are you outputting?

  3. #3
    f15e is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2016
    Posts
    71
    I finally found the answer. I am adding the string values into a 2 column listbox, using for loop, and was adding them as follows:
    Me.Table_List_Box.AddItem tbls_array(i, 0) & ";" & tbls_array(i, 1)

    Apparently if you have commas in your string, it will be truncated at the first comma and therefore you have to enclose the string with single quotes like so:
    Me.Table_List_Box.AddItem tbls_array(i, 0) & ";" & "'" & tbls_array(i, 1) & "'"

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

Similar Threads

  1. Problem with function to increment array index
    By ts_hunter in forum Programming
    Replies: 4
    Last Post: 12-23-2014, 07:18 PM
  2. Replies: 9
    Last Post: 07-21-2014, 06:40 PM
  3. Array problem
    By dbdvl in forum Programming
    Replies: 6
    Last Post: 12-03-2011, 07:34 AM
  4. Commas in CSV file
    By cotri in forum Forms
    Replies: 7
    Last Post: 01-28-2010, 03:53 PM
  5. Commas in a Combo
    By DJFayo in forum Forms
    Replies: 0
    Last Post: 10-18-2006, 12:13 PM

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