 <p>You will need to put the value into something so as you can compare it in the if statement. If I understand what you want then give this a try. I am also assuming you will get one result in the SQL statement.</p> <pre class="lang-vb prettyprint-override"><code> Set conn = New ADODB.Connection Set rs = New ADODB.Recordset conn.Open sConnString Set rs.ActiveConnection = conn strSQL = "SELECT [Contract Status] FROM [Investment Data] WHERE [Customer Number] =(" &amp; "SELECT [Customer Number] FROM [Excel 8.0;HDR=YES;DATABASE=" &amp; dbWb &amp; "]." &amp; dsh &amp; ")" rs.Open strSQL If Not rs.EOF Then xx = rs.GetRows Else 'do you code for not getting result rs.Close If xx(0, 0) = "Current" Then expiryPrompt = MsgBox("A previous entry from the same contract is currently active, would you like to expire current active contract?", vbYesNo, "Confirmation") Call Expiry Exit Sub Else MsgBox ("Entry has been entered into the database.") cN.Execute ssql Exit Sub End If </code></pre> <p>I also have not amended your code inside the if statement to follow my way I accessing the database.</p> <p>To answer your question in the coments. The result will be transposed into the variable. so accessing more than one row or column , you will need to do something like this.</p> <p>For getting the rows,</p> <pre class="lang-vb prettyprint-override"><code> For i = 0 To 9 Cells(i + 1, 1) = x(0, i) Next i </code></pre> <p>For getting the columns,</p> <pre class="lang-vb prettyprint-override"><code> For i = 0 To 9 Cells(1, i + 1) = x(i, 0) Next i </code></pre>