473,409 Members | 2,057 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

Help with opening form

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
1 1327
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Thompson Yip | last post by:
From time to time, I randomly receive "Can't updated, Currently locked" error 3218 or 3246 from the following code in one of my form with pessimistic lock for 70 users environment. Any problem with...
4
by: Mark | last post by:
the Following bit of code doesn't work. It seems to respond to the second, starting with 'add iif statement for Good Practice', but not to the first, starting 'add iif statement for archived' ...
2
by: chanchito_cojones | last post by:
hi there, I am needing some help with a database I am putting together. The database works off of a main Form, which then has buttons on it that will open up other forms. The problem I am having...
5
by: Steve Patrick | last post by:
Hi All You guys are my last hope, despite spending money on books and hours reading them I still can not achieve the results I need. I have designed a database in Access 2000 based on 1 table,...
3
by: Jim Evans | last post by:
Using code and suggestions from an earkier thread in this group, I have created the following cond for the open event of a form I am opening from the button click event of another form. ...
10
by: Jim H | last post by:
I sometimes get the following error from my Form's Dispose Method when the application is closing: ------------------------------------------------- An unhandled exception of type...
7
by: Richard | last post by:
I have a form with seven tapages. These span only one record with a large number of fields (textboxes). On Tabpage1 I display a number of read-only text boxes. This displays information about...
2
by: kmercer46 | last post by:
I am working with multiple forms using an Access Database, VB.Net, DataSet and OLEDB. Bacically the Add Member form is form 2, not the opening form which is the Menu. If the Add Member form was the...
6
by: cj | last post by:
Lets just take this example I'm looking at now. I'm looking at the help screen titled .NET Framework Class Library FolderBrowserDialog Class . It gives an example at the bottom that begins with:...
1
by: Coll | last post by:
I have a form with a subform on it. On my main form, you select an employee id number and the top portion of form fills in with data, and the bottom portion of the form,which is a subform, lists...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.