var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Whats wrong with this SQL statement
I am a newbie and I am stumped. Can someone tell me why this doesn't work?
Private Sub cmdCustSet_Click()
Dim sCust As String
Dim sCustID As String
Dim mySQL As String
sCustID = txtCustID.Text
.RecordSource = "SELECT CompanyName FROM tblCustomerInfo WHERE CustomerID = '" & sCustID & "'"
If (.Recordset.RecordCount = 1) Then
sCustID is a number.
Thanks for your help
What is Data2, and where are you declaring it?
What error or errant behavior is this giving?
If you're making your select statement criteria based on an integer or number field, use ".
i.e. WHERE CustomerID = " & sCustID & ""
If your making your select criteria based on a text or string field use '" (single quote, double quote.)
If your making your select criteria based on a date field use #".