473,398 Members | 2,113 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,398 software developers and data experts.

Report for one record on a form

1
I'm making a database to show which types of devices are installed at intersections and I want the form to print out details for only one intersection and not our entire County.

I'm getting an error message of "Syntax error (missing operator) in query expression."

I have a report that has an underlying query field with the name of "Intersection Name". I also have a field on my form with the term "Intersection Name".

Here is my VBA:

DoCmd.OpenReport stDocName, acPreview, , "[Intersection Name]=" & [Intersection Name]

If I understand correctly, "[Intersection Name]=" refers to my report field and the portion [Intersection Name] at the end refers to the field in my form and this VBA tries to match the form string for intersection name to the report string for intersection name.
Aug 17 '15 #1
1 765
Seth Schrock
2,965 Expert 2GB
Based on your field having the word "Name" at the end, I'm going to guess that that field's data type is Text. If that is the case, then you need quotes around the value that you are passing to it, like this:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport stDocName, acPreview, , "[Intersection Name]='" & [Intersection Name] & "'"
However, that would cause a Data Type Mis-match Error, so we will need to see the SQL code for your query on which your report is based to be able to fix the error that you are getting.
Aug 17 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Dalan | last post by:
I'm developing a report selection form and one of the elements of design is providing Date from/to text boxes. I have a Table that contains all of the information regarding the reports and did...
1
by: Nothing | last post by:
Question: I have a form, open to a record, displaying some information. I have a button, on the form, that I want to click and have a print funtion on it. I want it to print the current record to...
1
by: bruce | last post by:
Hello, I have a small form that pops up when a user moves off the current record of a rather sizeable data entry form. The purpose of this form is to list warnings about various fields on the...
5
by: Clownfish | last post by:
I have a report that joins 12 external tables, and works great. However, there is a time when I wish to skip printing a particular record. Background: The 12 tables all have the same fields,...
1
by: alex.gruenther | last post by:
I am new to Access and need help creating an edit record form. I've got a table called Player with attributes like name, address, phone, etc. I've created an edit player form with a combo box...
5
by: CrostonScottish | last post by:
I wonder if anybody can help me with this problem i have. I have the code below on the click property for a command button at the bottom a form i have so that when somebody has populated the form...
0
by: Goomba | last post by:
I am keeping track of artifacts from a certain place (cache) and certain owners. There are many artifacts to a cache and many artifacts to an owner, but cache and owner are not necessarily related....
1
by: FreeLunch | last post by:
I have a database in Access 2003 that was originally developed using XP. When the database is opened on a Vista computer, the font size in a report or form is bigger. (The reports/forms don't...
9
by: jmar93 | last post by:
I am new to Access and was hoping someone could help me with a question. On a report or form you can place "=Date()" in a text box to display the current date, is there a way to have it display the...
7
by: AccessGirl5050 | last post by:
I have 78 different classes in Excel that are linked into Access 2013 as individual tables. Each Table has Student name, class name, instructor name, certification #, Class date, and expiration date....
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.