473,467 Members | 1,981 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

dialog box

56 New Member
How do I get remove the dialog box that pops up each time a fax is getting ready to be sent. I just want them to go. Right now the user would have to click the yes each time.

I just want to have a message box show up that says you are about to seen 12 faxes do you want to send they click yes and 12 send with no dialog box if no the action cancels.

Expand|Select|Wrap|Line Numbers
  1. Dim db As DAO.Database
  2. Dim rst As DAO.Recordset
  3. Dim strName As String
  4. Dim strFaxNo As String
  5. Dim strFax As String
  6.  
  7.  Set db = CurrentDb
  8.  
  9. strSQL = "SELECT TProdInfo.ProdCd, TProdInfo.[Contact Name], TProdInfo.[Fax Number], tara.Keep FROM tara INNER JOIN TProdInfo ON tara.ProdCd = TProdInfo.ProdCd GROUP BY TProdInfo.ProdCd, TProdInfo.[Contact Name], TProdInfo.[Fax Number], tara.Keep, tara.Email HAVING (((tara.Keep)=True) AND ((tara.Email)=fOSUserName()));"
  10.  
  11. Set rst = db.OpenRecordset(strSQL)
  12.  
  13. rst.MoveFirst
  14.  
  15. Do Until rst.EOF
  16. gProdCd = rst!ProdCd
  17. strName = "/Name=" & rst![Contact Name]
  18. strFaxNo = "/Fax=" & rst![Fax Number]
  19.  
  20. strFax = strName & strFaxNo & "/<fax@faxit.travp.net>"
  21.  
  22. DoCmd.SendObject acSendReport, "RPCDemandFax", acFormatRTF, strFax, , , "Outstanding Property Casualty Policies", "Please Review the Following Outstanding Policies", False
  23. rst.MoveNext
  24. Loop
  25. End Sub
  26.  
Apr 5 '07 #1
14 2537
Denburt
1,356 Recognized Expert Top Contributor
I think this should work, I used the setwarnings command, this can be especially dangerous since you can delete everything in your db with no prompt if you do not return it to it's original state of true. You shouls add some error trapping in here and make sure if an error is trapped you set the setwarnings command = true in that area. Hope this helps.

Expand|Select|Wrap|Line Numbers
  1. Dim db As DAO.Database
  2. Dim rst As DAO.Recordset
  3. Dim strName As String
  4. Dim strFaxNo As String
  5. Dim strFax As String
  6. Setwarnings = false
  7.  Set db = CurrentDb
  8.  
  9. strSQL = "SELECT TProdInfo.ProdCd, TProdInfo.[Contact Name], TProdInfo.[Fax Number], tara.Keep FROM tara INNER JOIN TProdInfo ON tara.ProdCd = TProdInfo.ProdCd GROUP BY TProdInfo.ProdCd, TProdInfo.[Contact Name], TProdInfo.[Fax Number], tara.Keep, tara.Email HAVING (((tara.Keep)=True) AND ((tara.Email)=fOSUserName()));"
  10.  
  11. Set rst = db.OpenRecordset(strSQL)
  12. 'To prevent an error when your recordset is empty use the following
  13. If not rst.eof then
  14. rst.MoveFirst
  15. YesNo =  MsgBox ("You are about to enter " & rst.RecordCount & " records!", vbInformation+vbYesNo
  16. if YesNo = vbNo then exit sub
  17.  
  18. Do Until rst.EOF
  19. gProdCd = rst!ProdCd
  20. strName = "/Name=" & rst![Contact Name]
  21. strFaxNo = "/Fax=" & rst![Fax Number]
  22.  
  23. strFax = strName & strFaxNo & "/<fax@faxit.travp.net>"
  24.  
  25. DoCmd.SendObject acSendReport, "RPCDemandFax", acFormatRTF, strFax, , , "Outstanding Property Casualty Policies", "Please Review the Following Outstanding Policies", False
  26. rst.MoveNext
  27. Loop
  28. Setwarnings = true
  29. End Sub
  30.  
Apr 5 '07 #2
favor08
56 New Member
I think this should work, I used the setwarnings command, this can be especially dangerous since you can delete everything in your db with no prompt if you do not return it to it's original state of true. You shouls add some error trapping in here and make sure if an error is trapped you set the setwarnings command = true in that area. Hope this helps.

Expand|Select|Wrap|Line Numbers
  1. Dim db As DAO.Database
  2. Dim rst As DAO.Recordset
  3. Dim strName As String
  4. Dim strFaxNo As String
  5. Dim strFax As String
  6. Setwarnings = false
  7.  Set db = CurrentDb
  8.  
  9. strSQL = "SELECT TProdInfo.ProdCd, TProdInfo.[Contact Name], TProdInfo.[Fax Number], tara.Keep FROM tara INNER JOIN TProdInfo ON tara.ProdCd = TProdInfo.ProdCd GROUP BY TProdInfo.ProdCd, TProdInfo.[Contact Name], TProdInfo.[Fax Number], tara.Keep, tara.Email HAVING (((tara.Keep)=True) AND ((tara.Email)=fOSUserName()));"
  10.  
  11. Set rst = db.OpenRecordset(strSQL)
  12. 'To prevent an error when your recordset is empty use the following
  13. If not rst.eof then
  14. rst.MoveFirst
  15. YesNo =  MsgBox ("You are about to enter " & rst.RecordCount & " records!", vbInformation+vbYesNo
  16. if YesNo = vbNo then exit sub
  17.  
  18. Do Until rst.EOF
  19. gProdCd = rst!ProdCd
  20. strName = "/Name=" & rst![Contact Name]
  21. strFaxNo = "/Fax=" & rst![Fax Number]
  22.  
  23. strFax = strName & strFaxNo & "/<fax@faxit.travp.net>"
  24.  
  25. DoCmd.SendObject acSendReport, "RPCDemandFax", acFormatRTF, strFax, , , "Outstanding Property Casualty Policies", "Please Review the Following Outstanding Policies", False
  26. rst.MoveNext
  27. Loop
  28. Setwarnings = true
  29. End Sub
  30.  
this comes back with an sytanx error.

YesNo = MsgBox ("You are about to enter " & rst.RecordCount & " records!", vbInformation+vbYesNo


Also when do i return it to it's original state when I caputure the error or at the end of the loop
Apr 5 '07 #3
Denburt
1,356 Recognized Expert Top Contributor
this comes back with an sytanx error.

YesNo = MsgBox ("You are about to enter " & rst.RecordCount & " records!", vbInformation+vbYesNo
Also when do i return it to it's original state when I caputure the error or at the end of the loop

Missed a parenthesis.
YesNo = MsgBox ("You are about to enter " & rst.RecordCount & " records!", vbInformation+vbYesNo)

Expand|Select|Wrap|Line Numbers
  1. Public Sub Whatever()
  2. On error goto DumbErrorTrap
  3.  
  4. 'Do this and that
  5. loop
  6. setwarnings = true
  7.  
  8. Exit_DumbErrorTrap:
  9. Exit sub
  10.  
  11. DumbErrorTrap:
  12. setWarnings = true
  13. 'if you want put an error message here!
  14.  
Apr 5 '07 #4
favor08
56 New Member
Missed a parenthesis.
YesNo = MsgBox ("You are about to enter " & rst.RecordCount & " records!", vbInformation+vbYesNo)

Expand|Select|Wrap|Line Numbers
  1. Public Sub Whatever()
  2. On error goto DumbErrorTrap
  3.  
  4. 'Do this and that
  5. loop
  6. setwarnings = true
  7.  
  8. Exit_DumbErrorTrap:
  9. Exit sub
  10.  
  11. DumbErrorTrap:
  12. setWarnings = true
  13. 'if you want put an error message here!
  14.  
I had to add "end if" statements to get the code to work.

But the microsoft dialog box still opened up.

im db As DAO.Database
Dim rst As DAO.Recordset
Dim strName As String
Dim strFaxNo As String
Dim strFax As String
SetWarnings = False
Set db = CurrentDb


strSQL = "SELECT TProdInfo.ProdCd, TProdInfo.[Contact Name], TProdInfo.[Fax Number], tara.Keep FROM tara INNER JOIN TProdInfo ON tara.ProdCd = TProdInfo.ProdCd GROUP BY TProdInfo.ProdCd, TProdInfo.[Contact Name], TProdInfo.[Fax Number], tara.Keep, tara.Email HAVING (((tara.Keep)=True) AND ((tara.Email)=fOSUserName()));"

Set rst = db.OpenRecordset(strSQL)
'To prevent an error when your recordset is empty use the following
If Not rst.EOF Then
rst.MoveFirst
YesNo = MsgBox("You are about to Fax " & rst.RecordCount & " records!", vbInformation + vbYesNo)
If YesNo = vbNo Then
Exit Sub
End If
Do Until rst.EOF
gProdCd = rst!ProdCd
strName = "/Name=" & rst![Contact Name]
strFaxNo = "/Fax=" & rst![Fax Number]

strFax = strName & strFaxNo & "/<fax@faxit.travp.net>"

DoCmd.SendObject acSendReport, "RPCDemandFax", acFormatRTF, strFax, , , "Outstanding Property Casualty Policies", "Please Review the Following Outstanding Policies", False
rst.MoveNext
Loop
SetWarnings = True
End If
End Sub
Apr 5 '07 #5
Denburt
1,356 Recognized Expert Top Contributor
What does this dialog box say exactly?
Apr 5 '07 #6
favor08
56 New Member
microsoft office outlook

a program is try to automatically send e-mail on your behalf. do you want to allow this? etc

Actually even if I say "NO" it still happens. So NO is not stopping the fax from process.
Apr 5 '07 #7
MMcCarthy
14,534 Recognized Expert Moderator MVP
microsoft office outlook

a program is try to automatically send e-mail on your behalf. do you want to allow this? etc

Actually even if I say "NO" it still happens. So NO is not stopping the fax from process.
This is a standard outlook warning that can be turned off if you have admin privilages.
Apr 6 '07 #8
MMcCarthy
14,534 Recognized Expert Moderator MVP
This is a standard outlook warning that can be turned off if you have admin privilages.
If you need another solution have a look at this other thread ...

http://www.thescripts.com/forum/thread609479.html

Mary
Apr 6 '07 #9
favor08
56 New Member
This is a standard outlook warning that can be turned off if you have admin privilages.
i do have admin privilages, so how do I turn it off.
Apr 6 '07 #10
MMcCarthy
14,534 Recognized Expert Moderator MVP
i do have admin privilages, so how do I turn it off.
In Outlook go to options and under the security tab click on Attachment Security. Be careful though as this disables all attachment security.

Mary
Apr 7 '07 #11
Denburt
1,356 Recognized Expert Top Contributor
Found this, it will definately need some work but it should do what you need:

Outlook Warnings

Expand|Select|Wrap|Line Numbers
  1. Visual Basic 6 (VBA)
  2. OlSecurityManager.ConnectTo OutlookApp 
  3. OlSecurityManager.DisableOOMWarnings = True 
  4. On Error Goto Finally 
  5.   '... any action with protected objects ... 
  6. Finally: 
  7.   OlSecurityManager.DisableOOMWarnings = False 
  8.  
Apr 7 '07 #12
Denburt
1,356 Recognized Expert Top Contributor
The following link may help also, you will probably need to utilize some of the techniques mentioned in this article in order to implemente the above post.

http://support.microsoft.com/default...b;en-us;291120
Apr 7 '07 #13
NeoPa
32,556 Recognized Expert Moderator MVP
That's brilliant Denburt.
I will be looking to implement this at work from now on.
I Love The Scripts :)
Apr 10 '07 #14
Denburt
1,356 Recognized Expert Top Contributor
That's brilliant Denburt.
I will be looking to implement this at work from now on.
I Love The Scripts :)
Thanks, I had a similar issue a few years ago and as usual I can not seem to find that particular db. I am doing my best to keep up with my code storage db but it is an interesting project in itself. Glad you found it usefull.
Apr 10 '07 #15

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

Similar topics

1
by: Prosonman | last post by:
Hi, What is the best way to transfer variables to and from a dialog box? My project consists of a form with a number of controls, lets say three Labels, when a label is clicked it opens a dialog...
23
by: George | last post by:
Is there a way to customize the open file common dialog? I am trying to modify the button text so I can create a delete file common dialog. I need the same functionality of the open file common...
1
by: Carmine | last post by:
I'm currently writing a small program that churns on a repetitive task while displaying a progress & cancel modeless dialog. I've been having problems due to threadlocking, and I was wondering if...
4
by: Alexander | last post by:
Hi, I have written a program that takes on some operations much more time than I expected. As I have seen users clicking wildly on the screen to make something happen, I want to follow the...
6
by: bryanhobson | last post by:
I'm fairly new to c#, and I am just trying to work out how a 'properties' dialog works. Currently in my code, I have an object represented by the class 'Dog'. The dog object has several...
4
by: ronenk | last post by:
I have this code to load an authentication form once my app is loaded. I want the authentication form to be closed if a user is authenticated successfully and to give the option to close app on his...
10
by: Guadala Harry | last post by:
I have a modal dialog that currently does all of the following except item 4. 1. lets users select a graphic from a list of thumbnails (and when selected, displays the full-size image in a...
11
by: Zytan | last post by:
I have created a new form from the main form. When I close the main form with the 'x' close button, its Form.FormClosed event is run, but not the dialog's. Is this normal? It is ok /...
0
by: Moezzie | last post by:
So ive got a bit of a problem here. Ive been searching the net about this for quite some time now but i just cant seem to figure out how to open a dialog that ive made in QtDesigner. Of corse i...
11
by: VK | last post by:
In the continuation of the discussion at "Making Site Opaque -- This Strategy Feasible?" and my comment at http://groups.google.com/group/comp.lang.javascript/msg/b515a4408680e8e2 I have...
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
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
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...
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,...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.