Audit Trail - Syntax Error

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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
 
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
 
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
 
Back
Top