467,144 Members | 1,164 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,144 developers. It's quick & easy.

Single Quote in DoCmd ?

JAMBAI
Hi,

Is there a way to handle single quotes when inserting the records using the below do command. Or do I need to write Insert sql.

DoCmd.GoToRecord , , acNewRec

Thanks
Jambai
Feb 21 '07 #1
  • viewed: 1655
Share:
8 Replies
Rabbit
Expert Mod 8TB
I'm not quite sure what you're talking about but you can get single quotes by using:
Expand|Select|Wrap|Line Numbers
  1. "'"
Feb 21 '07 #2
JAMBAI
I'm not quite sure what you're talking about but you can get single quotes by using:
Expand|Select|Wrap|Line Numbers
  1. "'"

This will helpful for me only when I insert the records using insert sql statement.

Here I am trying to insert the records using DoCmd.Forms fields are bound to the table.

Thanks
Feb 21 '07 #3
Rabbit
Expert Mod 8TB
What DoCmd function are you trying to use to insert records?
Feb 21 '07 #4
JAMBAI
What DoCmd function are you trying to use to insert records?

DoCmd.GoToRecord , , acNewRec

Thanks
Feb 21 '07 #5
Rabbit
Expert Mod 8TB
DoCmd.GoToRecord , , acNewRec

Thanks
This will take you to a new record, it doesn't insert a new record. A new record is inserted only once you have begun to enter information and it is updated to the table. Whatever you type into the text boxes is what will be stored.
Feb 21 '07 #6
JAMBAI
This will take you to a new record, it doesn't insert a new record. A new record is inserted only once you have begun to enter information and it is updated to the table. Whatever you type into the text boxes is what will be stored.
The below code was created from the button wizard.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command34_Click()
  2. On Error GoTo Err_Command34_Click
  3.     DoCmd.GoToRecord , , acNewRec
  4. Exit_Command34_Click:
  5.     Exit Sub
  6. Err_Command34_Click:
  7.     MsgBox Err.Description
  8.     Resume Exit_Command34_Click
  9. End Sub
I need to check for existing record before the record is inserted into the table, I am solved the problem with single quote check,

Thanks
Jambai
Feb 21 '07 #7
Rabbit
Expert Mod 8TB
How do you determine if a record exists? Is there a primary key?
Feb 21 '07 #8
MMcCarthy
Expert Mod 8TB
The below code was created from the button wizard.

Private Sub Command34_Click()
On Error GoTo Err_Command34_Click
DoCmd.GoToRecord , , acNewRec
Exit_Command34_Click:
Exit Sub
Err_Command34_Click:
MsgBox Err.Description
Resume Exit_Command34_Click
End Sub
All this code does is to move the form to the add new record postition. You must have clicked on the wrong option in the wizard.

I need to check for existing record before the record is inserted into the table, I am solved the problem with single quote check,
Sorry Jambai you will have to explain this better as it doesn't make sense to us.

Mary
Feb 22 '07 #9

Post your reply

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

Similar topics

reply views Thread by Mark C via AccessMonster.com | last post: by
1 post views Thread by chris_huh | last post: by
2 posts views Thread by Greg (codepug@gmail.com) | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.