Audit Trail - Syntax Error

G

Guest

I have inherited a database into which I want to add Allan Browne's audit
trail.

All has been going well until I tested an edit on the first form to which I
have added the code. On exiting the form I get the message

"Syntax Error (Missing Operator) in query expression '(My Table.Primary ID =
13)'.

The names of the table and the primary id have spaces - a cardinal sin, I
know. Could this be the problem and, if so, is there a way around it without
renaming as they are so integral to the entire working of the database?

Thanking you in anticipation
 
G

Graham R Seach

Pace,

I'd have thought you would have got a different error, but yes, spaces in
object names can present problems. To resolve this type of problem, simply
enclose the object name in square brackets:
[My Table].Primary ID = 13

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
D

Douglas J. Steele

Don't forget the square brackets around the field name, too, since it also
has embedded spaces:

[My Table].[Primary ID] = 13


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Graham R Seach said:
Pace,

I'd have thought you would have got a different error, but yes, spaces in
object names can present problems. To resolve this type of problem, simply
enclose the object name in square brackets:
[My Table].Primary ID = 13

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

Pace said:
I have inherited a database into which I want to add Allan Browne's audit
trail.

All has been going well until I tested an edit on the first form to which
I
have added the code. On exiting the form I get the message

"Syntax Error (Missing Operator) in query expression '(My Table.Primary
ID =
13)'.

The names of the table and the primary id have spaces - a cardinal sin, I
know. Could this be the problem and, if so, is there a way around it
without
renaming as they are so integral to the entire working of the database?

Thanking you in anticipation
 
G

Graham R Seach

Thanks Doug, I didn't spot the space there.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

Douglas J. Steele said:
Don't forget the square brackets around the field name, too, since it also
has embedded spaces:

[My Table].[Primary ID] = 13


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Graham R Seach said:
Pace,

I'd have thought you would have got a different error, but yes, spaces in
object names can present problems. To resolve this type of problem,
simply enclose the object name in square brackets:
[My Table].Primary ID = 13

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

Pace said:
I have inherited a database into which I want to add Allan Browne's audit
trail.

All has been going well until I tested an edit on the first form to
which I
have added the code. On exiting the form I get the message

"Syntax Error (Missing Operator) in query expression '(My Table.Primary
ID =
13)'.

The names of the table and the primary id have spaces - a cardinal sin,
I
know. Could this be the problem and, if so, is there a way around it
without
renaming as they are so integral to the entire working of the database?

Thanking you in anticipation
 
G

Guest

Many thanks to both of you - that sorted me out.

Best regards

Graham R Seach said:
Thanks Doug, I didn't spot the space there.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

Douglas J. Steele said:
Don't forget the square brackets around the field name, too, since it also
has embedded spaces:

[My Table].[Primary ID] = 13


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Graham R Seach said:
Pace,

I'd have thought you would have got a different error, but yes, spaces in
object names can present problems. To resolve this type of problem,
simply enclose the object name in square brackets:
[My Table].Primary ID = 13

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

I have inherited a database into which I want to add Allan Browne's audit
trail.

All has been going well until I tested an edit on the first form to
which I
have added the code. On exiting the form I get the message

"Syntax Error (Missing Operator) in query expression '(My Table.Primary
ID =
13)'.

The names of the table and the primary id have spaces - a cardinal sin,
I
know. Could this be the problem and, if so, is there a way around it
without
renaming as they are so integral to the entire working of the database?

Thanking you in anticipation
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top