473,407 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Single Quote in DoCmd ?

JAMBAI
28
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
8 1941
Rabbit
12,516 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
28
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
12,516 Expert Mod 8TB
What DoCmd function are you trying to use to insert records?
Feb 21 '07 #4
JAMBAI
28
What DoCmd function are you trying to use to insert records?

DoCmd.GoToRecord , , acNewRec

Thanks
Feb 21 '07 #5
Rabbit
12,516 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
28
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
12,516 Expert Mod 8TB
How do you determine if a record exists? Is there a primary key?
Feb 21 '07 #8
MMcCarthy
14,534 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

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

Similar topics

1
by: RLN | last post by:
Re: Access 2000 I have a form (Form1) where the default view in the properties is set to "Datasheet". When I click on the Form1 object from the container to display it, it displays fine in...
1
by: Dave Alger | last post by:
Hi, I've got a subform which has its default view set to "Continuous Forms". What I want to be able to do is switch programatically between "Continuous" and "Single". I note that most View...
0
by: Mark C via AccessMonster.com | last post by:
Ok bare with me on this one.... I have 1 table "Expenses" that holds about 50 fields broken down into sub categories. I have a Subform tied to a main form so that when I pull up a client it...
10
by: Fendi Baba | last post by:
I am new to MS Access so please bear with me. I am trying to create a report format and attach a button to a form. This would users to print-out a record that they are looking at. I can report a...
3
by: Eddy | last post by:
I would like to export the output of 2 queries to excel namely: 1. QryProrationbyWBS_1 2. QryProrationbyWBS_2 However I want to do this using the same spreadsheet say sheet1 and sheet2 or...
0
by: Chris | last post by:
Hi, I am using the command below for exporting data to text file. One of the query columns has SINGLE number type with decimal ponts as auto. DoCmd.TransferText acExportDelim,...
1
by: chris_huh | last post by:
Using the Label Wezard you can easily make labels for all the records in the table, but is there a way to make just one. I have a form that shows the data from a single recordset and on that...
1
by: Ryan | last post by:
Hello. I was hoping that someone may be able to assist with an issue that I am experiencing. I have created an Access DB which imports an Excel File with a particular layout and field naming. ...
2
by: Greg (codepug | last post by:
acCmdPrint allows me to print using the Windows Dialog. Since I want to be able to select the printer of my choice, this works well. I put his behind a button on a single form. The problem is,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.