Reputation: 4 Apprentice
- Active Posts:
- 34 (0.05 per day)
- 22-June 11
- Profile Views:
- Last Active:
- Apr 12 2012 01:53 PM
- OS Preference:
- Favorite Browser:
- Favorite Processor:
- Favorite Gaming Platform:
- Your Car:
- Who Cares
- Dream Kudos:
Posts I've Made
Posted 25 Jul 2011I used Lebans for the convertor, you can google it and download it.
'DEVELOPED AND TESTED UNDER MICROSOFT ACCESS 97 through A2003
'Copyright: Stephen Lebans - Lebans Holdings 1999 Ltd.
' Plain and simple you are free to use this source within your own
' applications. whether private or commercial, without cost or obligation, other that keeping
' the copyright notices intact. No public notice of copyright is required.
' You may not resell this source code by itself or as part of a collection.
' You may not post this code or any portion of this code in electronic format.
' The source may only be downloaded from:
delete file function
Private Declare Function DeleteFile Lib "kernel32.dll" Alias _ "DeleteFileA" (ByVal lpFileName As String) As Long ' Declaration
Posted 21 Jul 2011Hi,
I'm trying to use your code but something is missing.
In your Private Sub generatePDF you Call ConvertReportToPDF and DeleteFile but this is not present in your example.
Yeah I was just trying to answer the question I asked before I left the thread. When I head in to work today I can dig out those functions and paste them in here for you.
Posted 12 Jul 2011Ok I figured it out. It was what I had thought and there were too many queries on the stack that had not completed. When the after update finishes it tries to run whatever I queried in the code and it's own command which somehow conflict. I would love to know more about this and how it's functioning more technically.
This DoCmd will save the current change from the bound field and then the code within it's event can run after without conflict.
Private Sub chkVisa_Click() DoCmd.RunCommand acCmdRefresh If chkVisa.Value = True Then CurrentDb.Execute ("UPDATE Orders SET Visa=Yes, InvoiceSent=Yes, PaidDate=#" & Format(Int(Now()), "mm/dd/yy") & "# WHERE OrderID=" & txtOrderID.Value & ";") Else CurrentDb.Execute ("UPDATE Orders SET Visa=No, InvoiceSent=No, PaidDate=Null WHERE OrderID=" & txtOrderID.Value & ";") End If Me.Refresh End Sub
Posted 12 Jul 2011This works when I unbind the checkbox. So it has directly to do with the ordering of the stack. Basically when it's bound and checked, and I run a click event it sends 2 queries to the stack for the same table. I would like to know a way to force the click code to run the query, update, then close it's connection so when it finishes and the check updates its bound field there is no conflict.
This is the final code that worked, unfortunately I had to suppliment with an on current even that checks if the field in the DB is True/False to update the form. Seems much less efficient than it could be, would love any other suggestions to do this with a bound field.
Private Sub chkVisa_Click() If chkVisa.Value = True Then CurrentDb.Execute ("UPDATE Orders SET Visa=Yes, InvoiceSent=Yes, PaidDate=#" & Format(Int(Now()), "mm/dd/yy") & "# WHERE OrderID=" & txtOrderID.Value & ";") Else CurrentDb.Execute ("UPDATE Orders SET Visa=No, InvoiceSent=No, PaidDate=Null WHERE OrderID=" & txtOrderID.Value & ";") End If Me.Refresh End Sub
I'm gonna throw you a rep for suggesting the bound fields fix but asking for a DB that is obviously dealing with credit card and financial data is a little fishy when I am supplying the relevant code to my problem.
Posted 12 Jul 2011would you mind sending me the access file so I can take a gander at the problem and the steps it takes to replicate the problem?
Sorry that's not possible. It's my office DB and the data is quite sensitive. Do you think if I use dao recordsets and edit then close them it will help?
- Member Title:
- New D.I.C Head
- Age Unknown
- Birthday Unknown
- Years Programming:
- Programming Languages:
- VB.NET, VBA, PHP, C, (HTML, SQL)
- Click here to e-mail me