473,397 Members | 2,028 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,397 software developers and data experts.

Adding an "INSERT INTO" SQL

25
Hello again.
I have the following code attached to the onclick event of a command button:

Expand|Select|Wrap|Line Numbers
  1. Dim strQry As String
  2.  
  3.    strQry = "INSERT INTO [Inspected by] ([Return No]) VALUES ('" & Me!Text80 & "')"
  4.    DoCmd.RunSQL strQry
  5.  
  6.    DoCmd.GoToRecord , , acNewRec
  7.  
  8.    MsgBox "The return has been entered into the system", , "RETURN ENTERED"
  9.  
When the code is executed a system generated message box appears warning you that "you are about the append a row to a table" and allowing you to cancel if wanted. Is there any way to keep this message from appearing?

Whenever a new record is entered into a certain table I need to have a row added to a related table but don't want to give the user the ability to cancel.
Thanks!
Jun 28 '07 #1
2 1795
FishVal
2,653 Expert 2GB
Hello again.
I have the following code attached to the onclick event of a command button:

Expand|Select|Wrap|Line Numbers
  1. Dim strQry As String
  2.  
  3. strQry = "INSERT INTO [Inspected by] ([Return No]) VALUES ('" & Me!Text80 & "')"
  4. DoCmd.RunSQL strQry
  5.  
  6. DoCmd.GoToRecord , , acNewRec
  7.  
  8. MsgBox "The return has been entered into the system", , "RETURN ENTERED"
  9.  

When the code is executed a system generated message box appears warning you that "you are about the append a row to a table" and allowing you to cancel if wanted. Is there any way to keep this message from appearing?

Whenever a new record is entered into a certain table I need to have a row added to a related table but don't want to give the user the ability to cancel.
Thanks!
Hi!

Use
DoCmd.SetWarnings [False/True]
to turn off/on Access warnings.

Good luck
Jun 28 '07 #2
teric2
25
Excellent, Just what I needed!

Thanks for the help!
Jun 28 '07 #3

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

Similar topics

2
by: newbie_mw | last post by:
Hi, I need urgent help with a novice problem. I would appreciate any advice, suggestions... Thanks a lot in advance! Here it is: I created a sign-up sheet (reg.html) where people fill in their...
1
by: newbie_mw | last post by:
Seems my post was buried in more cries for help :-) I will try again. It's probably a very novice question so please take a look! Thanks!...
9
by: Luc Dal | last post by:
Hello, I've serious problem using ASP under WindowsXP sp2. I get the following reply (sorry it's in french) Erreur de compilation Microsoft VBScript error '800a0401' Fin d'instruction...
5
by: Chad Richardson | last post by:
Is there a way in SQL Server 2000 to extract data from a table, such that the result is a text file in the format of "Insert Into..." statements, i.e. if the table has 5 rows, the result would be 5...
2
by: CFW | last post by:
I use the following flawlessly to insert a single field: strSQL = "Insert into (Casket) Values " _ & "(" & conQuote & NewCasket & conQuote & ")" Set db = CurrentDb If MsgBox(NewCasket & " is...
6
by: Rich | last post by:
Hello, I have to create a table in an Access mdb (remotely) on the fly. Create Table tbl1(fld1 Integer, fld2 varchar(10), fld3...) Then I have to insert data: Insert Into tbl1 Values(" &...
20
by: Mark Harrison | last post by:
So I have some data that I want to put into a table. If the row already exists (as defined by the primary key), I would like to update the row. Otherwise, I would like to insert the row. I've...
5
by: djsdaddy | last post by:
Good Day All, I have some EEO data in an old dBase4 database that I have converted to an Access table. Since dBase was not a relational database, I didn't create any key fields. I linked all of the...
3
by: Twanne | last post by:
Hi, I've got a table called Aerosol and a table called LinkTabel. Now I do an update to a table from an excell sheet, this table is called ExportAerosol. So far so good, the import works...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.