title: Docmd.Openform Opening a blank Form?
body: <p>I have a small piece of code that is embedded into a button on a continuous form.  It will open a form to give additional details not on the search result.  </p>
  
  <p>My problem is this, It seems that when all the details are present the form opens correctly, if any fields are missing (say a pay date or voucher number), the form opens blank?</p>
  
  <p>Here is the code for the search query, and the code to the button to open the form:</p>
  
  <pre><code>Private Sub Command1_Click()
  Dim strsearch As String
  Dim strText As String
  strText = Me.txtSearch.Value
  strsearch = "Select * from tblInvoiceLog where Vendor_Number like ""*" &amp; strText &amp; "*"" or Vendor_Name like ""*" &amp; strText &amp; "*"" or Invoice_1 like ""*" &amp; strText &amp; "*"" or Invoice_2 like ""*" &amp; strText &amp; "*"" or Invoice_3 like ""*" &amp; strText &amp; "*"" or Invoice_4 like ""*" &amp; strText &amp; "*"" or Invoice_5 like ""*" &amp; strText &amp; "*"" or Check_Request_Total like ""*" &amp; strText &amp; "*"" or Voucher_Number like ""*" &amp; strText &amp; "*"" or Notes like ""*" &amp; strText &amp; "*"" or TransAction_Id like ""*" &amp; strText &amp; "*"" ORDER BY [Pay_Date] DESC"
  Me.RecordSource = strsearch
  End Sub
  
  Private Sub Command53_Click()
  DoCmd.OpenForm "frm: Check Request Info (Redesign)", , , "TransAction_Id = " &amp; TransAction_ID
  End Sub
  </code></pre>
  
  <p>I thought I accounted for all the variables in this equation?
  Can any one offer a suggestion?</p>