chris-uk-lad
Registered User.
- Local time
- Today, 07:56
- Joined
- Jul 8, 2008
- Messages
- 271
Hi,
I currently have a search form where as i type in the name of an owner and it displays a list of records relating to that owner. I want to then be able to click on one of the records in the list and it open the form displaying the results (frmAddRecord in this case). Below is the code im using.
But this gives me the error: 3075
Syntax error (missing operator) in query expression '[Owner]=Chris Jones".
Any Thoughts??
Thanks
I currently have a search form where as i type in the name of an owner and it displays a list of records relating to that owner. I want to then be able to click on one of the records in the list and it open the form displaying the results (frmAddRecord in this case). Below is the code im using.
Code:
Option Compare Database
Option Explicit
Dim strSQL As String
Const strSQL1 = "SELECT DISTINCT Sheet1.Owner, Sheet1.[Request Type], Sheet1.Comments FROM Sheet1 WHERE Sheet1.Owner ="
Private Sub cmdClear_Click()
Me!lstResults.ColumnCount = 3
Me!lstResults.ColumnWidths = "0cm;5cm;9cm"
Me!lstResults.RowSource = ""
End Sub
Private Sub cmdClose_Click()
DoCmd.Close
End Sub
Private Sub cmdSearch_Click()
sBuildSQL
End Sub
Sub sBuildSQL()
If Not IsNull(Me!txtOwner) Then
strSQL = strSQL1 & "'" & Me!txtOwner & "'"
Me!lstResults.ColumnCount = 5
Me!lstResults.ColumnWidths = "0cm;5cm;9cm;1cm;1cm"
Me!lstResults.RowSource = strSQL
End If
End Sub
Private Sub lstResults_DblClick(Cancel As Integer)
DoCmd.OpenForm "frmAddRecord", , , "[Owner]=" & Forms!frmViewUserList!lstResults
End Sub
But this gives me the error: 3075
Syntax error (missing operator) in query expression '[Owner]=Chris Jones".
Any Thoughts??
Thanks