By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,476 Members | 889 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,476 IT Pros & Developers. It's quick & easy.

Help with opening form

P: n/a
Help,
Can anyone tell me what I am doing wrong? I am trying to open a form to
edit a record. This is my code

Dim stDocName As String
Dim stLinkCriteria As String
Dim stLinkCriteria1 As String
Dim stLinkCriteria2 As String
stDocName = "frmTCPupdate"
stLinkCriteria = "[Project ID]=" & Me![Project Id]
stLinkCriteria1 = "[operator]=" & Me![Operator]
DoCmd.OpenForm stDocName, , , stLinkCriteria & " AND " & stLinkCriteria1
I get an error message saying syntax error (missing operator in query
expression project id = 77 and Operator = Orange

can anyone help

Thanks in advance
Dave

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
It looks like Operator is a Text Field and the supplied value must be
inclosed in quotes. Try:

stLinkCriteria = "([Project ID]=" & Me![Project Id] & ")"
stLinkCriteria1 = "([operator]=""" & Me![Operator] & """)"
DoCmd.OpenForm stDocName, , , stLinkCriteria & " AND " & stLinkCriteria1
--
Van T. Dinh

"Dave" <da***********@btinternet.com> wrote in message
news:d3**********@sparta.btinternet.com...
Help,
Can anyone tell me what I am doing wrong? I am trying to open a form to edit a record. This is my code

Dim stDocName As String
Dim stLinkCriteria As String
Dim stLinkCriteria1 As String
Dim stLinkCriteria2 As String
stDocName = "frmTCPupdate"
stLinkCriteria = "[Project ID]=" & Me![Project Id]
stLinkCriteria1 = "[operator]=" & Me![Operator]
DoCmd.OpenForm stDocName, , , stLinkCriteria & " AND " & stLinkCriteria1

I get an error message saying syntax error (missing operator in query
expression project id = 77 and Operator = Orange

can anyone help

Thanks in advance
Dave


Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.