title: Allow for empty values in an array
body: <p>I am writing a program to read barcodes. I need to read both QR barcodes (with an array) as well as regular barcodes that have one value.</p>
  <p>As of now, the code will not accept anything other than QR/Array barcodes.</p>
  <p>The program used to accept both barcodes, but would not insert any QR barcode information into the table except Array(0). Whether I scanned a regular barcode (with just the product name) or a QR barcode with many values, only the name would wind up in the table.</p>
  <p>I have now edited the SQL INSERT INTO statement to insert all of the QR barcode array values. The problem is that the form where the scan is performed will no longer accept regular barcodes (just the product name).</p>
  <p>I tried adding the &quot;OR ''&quot; to account for a possible empty value, but the form will still not accept this.</p>
  <p>Here is where I defined the array:</p>
  <pre class="lang-vb prettyprint-override"><code>fValue = Split(Me.txtScanArea.Value, &quot;,&quot;)
  BCName = fValue(0)
  LotNo = fValue(1)
  Serial = fValue(2)
  Exp = fValue(3)
  Weight = fValue(4)
  SName = fValue(5)
  </code></pre>
  <p>The corresponding SQL statement.</p>
  <pre><code>sql = &quot;INSERT INTO dbo_ScanLog (Lot, Type, &quot; &amp; _
        &quot;Serial, ScanName, ScanProcess, ScanLot, Expired, &quot; &amp; _
        &quot;Weight, SPN, ScanWarning, Loc, Category, ScanCount, ScanDate) &quot; &amp; _
        &quot;VALUES('&quot; &amp; pbl_Lot &amp; &quot;','&quot; &amp; _
        pbl_Name &amp; &quot;','&quot; &amp; Serial &amp; &quot;' OR '','&quot; &amp; _
        BCName &amp; &quot;',1,'&quot; &amp; LotNo &amp; &quot;' OR '','&quot; &amp; Exp &amp; &quot;' OR '','&quot; &amp; _
        Weight &amp; &quot;' OR '','&quot; &amp; SName &amp; &quot;' OR '','&quot; &amp; _
        msg &amp; &quot;','C','F',&quot; &amp; _
        iCount &amp; &quot;,#&quot; &amp; Now() &amp; &quot;#)&quot;
  
  InsertDB (sql)
  </code></pre>
  <p>It will accept a QR barcode (which would read as: ProName,J0801-2019,SN123456,2019.12.25,5,123456,2019.08.01), but not a regular barcode (which would read as: ProName).</p>
  <p>When I enter the information for a regular barcode into the Access form, hitting enter will not even attempt to insert the info into the database. It just sits in the form entry, whereas inserting a QR scan and hitting enter will add it to our database.</p>