I don't know if you are still looking for this answer, but I use this code snippet as the first item in the function called from the autoexec macro and it works with no problems.
If Not CurrentProject.IsConnected Then
If gbDevelopment Then
CurrentProject.OpenConnection...
Lloyd,
Love the quote - one of Cusack's funniest lines.
As to your question, you will probably need some more information to go with lespauls FAQ links. I have done this same thing and what I did was to export the reports to a temp folder (using DoCmd.OutputTo acOutputReport, rptLeadCardsByRep"...
I believe DateValue is the function you need. For instance DateValue(#4/5/2006 12:01:00#)=#04/05/06# will return True. This takes formatting out of it.
Genimuse,
I just created a simple form and tried to duplicate your issue. My button deleted the record and didn't trigger the OnCurrent event. Can you post the code you added to the wizard generated Delete code? You must do something to make the form move to a new record.
Connection does not matter one way or the other. It doesn't hurt to have it in.
I just duplicated your scenario and the only way I could get your error was if [0001 Bin Detail].Cust was not a text value. If this is the case just get rid of the single quotes in your SQL string and you will be fine.
There isn't a new record created until you add some data to a field in the recordset. If you just move off the 'new' record (for example Me.Recordset.MoveFirst) I believe you won't have any issues.
Thanks, I figured it out before your reply, but thanks for taking the time to answer. As a side note, if you are trying to do this on an NT 4.0 machine (as I was), it takes a little more care in use and distribution of the ActiveDS library. If someone reading this thread needs a link to more...
I believe it is looking for IDHold. If this is a variable, you will have to put the value in the text (like "DELETE FROM tempTbl WHERE txtID=" & IDHold & ";"
If my query has [Forms!frmMain!txtName] as a parameter and [Forms!frmMain!txtName2] as another parameter, then how would you differentiate between the two. Would you use...
qdf.parameters(1)=Forms!frmMain!txtName
qdf.parameters(2)=Forms!frmMain!txtName2"
Yes, though I think I made a mistake...
Make it recursive.
'Declare global variable
Public FsO As FileSystemObject
'Trigger sub
Sub ShowAllFiles
Set FsO = New FileSystemObject
ShowFiles(FsO.GetFolder("H:\Inv\pls\"))
set FsO = Nothing
end sub
'Master function
Public Sub ShowFiles (fldr as Folder)
Dim fld As Folder
Dim fiL As File...
To reinforce/enhance Skip's point:
(From the MSDN site)
The Date Data Type
VBA provides the Date data type to store date and time values. The Date data type is an 8-byte floating-point value, so internally it's the same as the Double data type. The Date data type can store dates between January...
Just a suggestion:
If you make the name and location of the Excel file the same each month you won't have to worry about relinking. If you don't want to do this because you keep them as history I might suggest something like this - Each month you copy the new file into...
Ed,
No offense intended, it wasn't clear to me that the Docmd.Openquery was the solution. I am interested to know, does this occur randomly among queries or just with specific queries? In other words, will the same query trigger this error sometimes and not others, or once a query generates this...
The SetWarnings answer is for a different issue. Action queries like update and maketable normally prompt user with different information and Docmd.SetWarnings False stops these prompts. What you are seeing is not really a 'Problem' but just an issue that has to be dealt with when running...
I am trying to import AP data into the AP Data Entry table and having some problem. I have a delimited file with vendor code, amt, and date. I tested the import thru VI into the ABC test company and it worked fine. When I set up the job for my client, using the same settings, it fails on four of...
Place this VBA code in a module.
Sub ExportProperties()
Dim oExcel As New Excel.Application
Dim oWkbk As Excel.Workbook
Dim oWksht As Excel.Worksheet
Set oExcel = CreateObject("Excel.application")
Set oWkbk = oExcel.Workbooks.Add
Set oWksht = oWkbk.Worksheets(1)
With oWksht...
[Forms]![MALAZA]![JOBCARDSID]
I am assuming that the form you are referencing is named MALAZA and the control is name JOBCARDSID, is that the case? If it is, just as an aside, it's terribly confusing to not use standard naming conventions in your apps. See
thread181-293590.
From the Help file for Add Method (Folders Collection). Maybe you just didn't realize that Contacts is an Address book??
Creates a new folder in the Folders collection, and returns the new folder as a MAPIFolder object.
Syntax
objFolders.Add(Name, [Type])
objFolders...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.