Question : sql syntax help in my vba code when primary key field has spaces

Everthing works great.  The only problem that I have is that if I change the primary key field name to include spaces then I get a query syntax error in the ajbaudit module.  I have changed the primary field name form MailingListID to Mailing List ID and just need final syntax error help with this and all done.  I will be encountering many tables in my project with this scenario and needed your help.  I have posted the db.  Just open the form and make a record change on the first record and close out the form and you will get the syntax error where I will need an expert's help with.
Attachments:
 
 

Answer : sql syntax help in my vba code when primary key field has spaces

sxxgupta,

If your table/column/control names have spaces, puncuation, etc--anything other than letters, digits, and underscores--you must place them in square brackets: [Mailing List ID].

Best practice: eschew the spaces, and just use letters, numbers, and underscores!

Patrick
Random Solutions  
 
programming4us programming4us