473,467 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Access 2007 subform sort

I have a form in Access 2007 containing a subform. The control source
of the latter is

SELECT DISTINCTROW [Catchwords].[Catchword], [Catchwords].[Part of
speech], [Catchwords].[Explanation], [Catchwords].[Catchword ID],
[Catchwords].[Citation ID] FROM [Catchwords];

which is undoubtedly correct.

However, if I click on the down arrow on the subform header (the one
that should bring up the sort and filter menu) I get this error:

Syntax error in query expression '[SELECT DISTINCTROW [Catchwords]].
[Catchword], [Catchwords].[Part of speech], [Catchwords].
[Explanation], [Catchwords].[Catchword ID], [Catchwords].[[Citation
ID] FROM [Catchwords];].[Citation ID]'.

This is clearly incorrect SQL! Note the extra square brackets and the
extra item after the semicolon at the end.

Interestingly, this only happens on the header for "Catchword" and
"Part of speech", not for "Explanation", presumably because the last
of these is a memo field.

Can anyone suggest a reason for this?

Feb 11 '07 #1
7 7859
Forms don't have a Control Source, so I will assume this SQL statement is in
the subform's Record Source property.

If Access is that confused about things, Name AutoCorrect is the first
culprit that comes to mind. Try this sequence:

1. Open the subform directly in design view, and delete the RecordSource so
the form is unbound. Save. Close.

2. Open the main form in design view, and delete the Link Master Fields and
Link Child Fields entries from the properties of the subform control. Save
Close.

3. Uncheck the boxes under:
Office Button | Access Options | Current Database | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

4. Compact the database:
Office Button | Manage | Compact/Repair

5. Restore the RecordSource of the subform, by pasting in the SQL statement
again. Test the subform as a stand alone form to make sure it's working
correctly.

6. Restore the Link Master Fields and Link Child Fields again.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"wwwords" <mi*************@gmail.comwrote in message
news:11*********************@q2g2000cwa.googlegrou ps.com...
>I have a form in Access 2007 containing a subform. The control source
of the latter is

SELECT DISTINCTROW [Catchwords].[Catchword], [Catchwords].[Part of
speech], [Catchwords].[Explanation], [Catchwords].[Catchword ID],
[Catchwords].[Citation ID] FROM [Catchwords];

which is undoubtedly correct.

However, if I click on the down arrow on the subform header (the one
that should bring up the sort and filter menu) I get this error:

Syntax error in query expression '[SELECT DISTINCTROW [Catchwords]].
[Catchword], [Catchwords].[Part of speech], [Catchwords].
[Explanation], [Catchwords].[Catchword ID], [Catchwords].[[Citation
ID] FROM [Catchwords];].[Citation ID]'.

This is clearly incorrect SQL! Note the extra square brackets and the
extra item after the semicolon at the end.

Interestingly, this only happens on the header for "Catchword" and
"Part of speech", not for "Explanation", presumably because the last
of these is a memo field.

Can anyone suggest a reason for this?
Feb 11 '07 #2
Forms don't have a Control Source, so I will assume this SQL statement is in
the subform's Record Source property.
You're right, of course.
If Access is that confused about things, Name AutoCorrect is the first
culprit that comes to mind. Try this sequence:
Unfortunately that doesn't resolve the problem, as the "Track name
AutoCorrect info" option is already turned off.

I've just tried recreating the subform using the Access wizard. This
produces the same SQL code for the Record Source (hardly a surprise)
but the the error message has changed slightly (note the extra square
brackets are now only around one item, there's no final semicolon and
the FROM parameter should correctly be just "[Catchwords]" as the name
of the table; so wonder the program says there's a syntax error!):

Syntax error in query expression '[SELECT DISTINCTROW [Catchwords]].
[Catchword], [Catchwords].[Part of speech], [Catchwords].
[Explanation], [Catchwords].[Catchword ID], [Catchwords].[[Citation
ID] FROM [Catchwords][Citation ID]'.

It looks as though Access is itself wrongly reading the Record Source
SQL!

Feb 11 '07 #3
What Access is doing here makes no sense.

What happens if you create a query, save it, verify it's working, and then
use the name of the saved query as the RecordSource of the subform?

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"wwwords" <mi*************@gmail.comwrote in message
news:11**********************@s48g2000cws.googlegr oups.com...
>Forms don't have a Control Source, so I will assume this SQL statement is
in
the subform's Record Source property.

You're right, of course.
>If Access is that confused about things, Name AutoCorrect is the first
culprit that comes to mind. Try this sequence:

Unfortunately that doesn't resolve the problem, as the "Track name
AutoCorrect info" option is already turned off.

I've just tried recreating the subform using the Access wizard. This
produces the same SQL code for the Record Source (hardly a surprise)
but the the error message has changed slightly (note the extra square
brackets are now only around one item, there's no final semicolon and
the FROM parameter should correctly be just "[Catchwords]" as the name
of the table; so wonder the program says there's a syntax error!):

Syntax error in query expression '[SELECT DISTINCTROW [Catchwords]].
[Catchword], [Catchwords].[Part of speech], [Catchwords].
[Explanation], [Catchwords].[Catchword ID], [Catchwords].[[Citation
ID] FROM [Catchwords][Citation ID]'.

It looks as though Access is itself wrongly reading the Record Source
SQL!
Feb 11 '07 #4
On Feb 11, 2:53 pm, "Allen Browne" <AllenBro...@SeeSig.Invalidwrote:
What Access is doing here makes no sense.

What happens if you create a query, save it, verify it's working, and then
use the name of the saved query as the RecordSource of the subform?
Doing that resolves the problem! Thanks for the suggestion. Might this
be a bug in Access 2007?
Feb 11 '07 #5
A quick follow-up question. Is it possible to disable the down arrow
on the subform header? The menu that comes up isn't relevant to our
needs and will only cause confusion!
Feb 11 '07 #6
I'm not clear what you mean by the down arrow in the subform header.

Is this the shortcut menu (right-click)? If so, you could open the subform
in design view, and set its Shortcut Menu property to No.

Or is this a control you added to the Form Header section of the form in the
subform control?

Or?

At this stage, I would not assume it's an A2007 bug.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"wwwords" <mi*************@gmail.comwrote in message
news:11**********************@v33g2000cwv.googlegr oups.com...
>A quick follow-up question. Is it possible to disable the down arrow
on the subform header? The menu that comes up isn't relevant to our
needs and will only cause confusion!
Feb 12 '07 #7
On Feb 12, 12:45 am, "Allen Browne" <AllenBro...@SeeSig.Invalid>
wrote:
I'm not clear what you mean by the down arrow in the subform header.

Is this the shortcut menu (right-click)? If so, you could open the subform
in design view, and set its Shortcut Menu property to No.
Many thanks again. That was the one I meant.
Feb 13 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Joseph J. Egan | last post by:
I am extending an existing Access/VBA app and need to update a subform displayed in continuous view within a containing form. The existing form and subform have worked fine to date with the...
6
by: ARC | last post by:
Ok, so I'm looking at Access 2007, and I have imported my existing Access 97 application. I'm feeling a bit overwelmed in what to do here. In my original 97 application, I had one form: Mainmenu,...
5
by: ARC | last post by:
Just found out something interesting with Access 2007... In table design, if you set a memo field to the new rich text option, and put that control on a form, set the control to rich text, you can...
17
by: Neil | last post by:
A client of mine likes some of the new bells and whistles in Access 2007, and is thinking about converting our A03 format MDB to an A07 format file. However, while some of the users have A07, many...
8
by: elias.farah | last post by:
Hello Everyone, I'm having some very weird behavior on a couple of Access forms. (Not all forms, just some of them). The forms have been working for years, under Access XP/2003 etc, and last...
5
by: CindySue | last post by:
I'm using a subform linked to the main form by a bidder number field. In the subform, I added a group header and put the field LS in it so that it would list all records designated as Live first...
1
by: mvlt | last post by:
I recently made the switch from Access 2003 to Access 2007. The rest of our office is still operating on 2003, so the database is still a 2003 file. We're having trouble with a few forms that work...
1
by: Shaun | last post by:
Hi all I have converted an accress XP data file to access 2007. The problem I now have is I cant add any data to the subforms. I have enabled all the allow options but still no go! Please help...
4
by: hausj0dw | last post by:
How can I rermove the sort option on columns displayed on a form. This database is access 2003, some users have access 2007. The 2007 users want the sort option removed.
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,...
1
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...
1
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.