SunQuest
 
           Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old April 12th, 2004, 10:45 AM
rance rance is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 3 rance User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
How to turn off that annoying "you are about to ..." message in access

Situation: Access database is based on linked tables to another database

problem, anytime I need to insert or update a field in one of my linked tables I get an annoying popup that asks if Im sure I want to "append/insert/delete X records"

Problem, if a user says no, then my data is hosed.

im generating the sql statements via vba code behind the scenes after users click buttons and so forth.

example:

Private Sub defaultfulfillment_Click()
Dim loadid As String
Dim orderno As String
Dim productno As String
Dim fulfillmentno As Integer
Dim con As Object
Dim rs As Object
Dim fulfillmentcount As Object
Dim rs2 As Object
Dim strSQL As String
loadid = Forms!loadheader!formloadno.Value
fulfillmentno = 0
Set con = Application.CurrentProject.Connection
strSQL = "SELECT Max([FULFILLMENT_ITEM]) AS maxcount FROM DB2ADMIN_LOAD_FULFILLMENTS"
Set fulfillmentcount = CreateObject("ADODB.Recordset")
fulfillmentcount.Open strSQL, con, 1
If (fulfillmentcount![maxcount] >= 1) Then
fulfillmentno = CLng(fulfillmentcount![maxcount])
End If

strSQL = "select [ORDER_NO] from [DB2ADMIN_LOAD_ITEMS] where [LOAD_ID]=" & loadid
Set rs = CreateObject("ADODB.Recordset")
rs.Open strSQL, con, 1
While (Not (rs.EOF))
Set rs2 = CreateObject("ADODB.Recordset")
strSQL = "select [PRODUCT], CLng([CASES_ORDERED]) as CASES from [DB2ADMIN_ORDER_DETAIL] where [ORDER_NUMBER]='" & rs![ORDER_NO] & "'"
rs2.Open strSQL, con, 1
While (Not (rs2.EOF))
fulfillmentno = fulfillmentno + 1
strSQL = "insert into [DB2ADMIN_LOAD_FULFILLMENTS] ([FULFILLMENT_ITEM],[LOAD_ID],[ORDER_NO],[PRODUCT],[CASES],[WAREHOUSE]) values ("
strSQL = strSQL & fulfillmentno & "," & loadid & ",'" & rs![ORDER_NO] & "','" & rs2![PRODUCT] & "'," & rs2![CASES] & ",'350')"
DoCmd.RunSQL strSQL
rs2.MoveNext
Wend
rs.MoveNext
Wend

Forms!loadheader.Requery
Forms!loadheader.Refresh

End Sub

anytime I use the DoCmd.RunSQL method the computer asks if Im sure I want to insert the records.

this particular nested while loop could possibly insert 60 records or more, I sure dont want to depend on a user to click yes 60 times before they can go on to the next thing.

what do I need to change

Reply With Quote
  #2  
Old April 13th, 2004, 10:37 AM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 18 h 33 m 48 sec
Reputation Power: 180
Why don't you just run your insert in code?

con.execute(strSQL)
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > How to turn off that annoying "you are about to ..." message in access


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway