I'm trying to write some code to use Python to create a real Excel 2010 file from one of the iSeries files. I've created a command that accepts an SQL statement and an output location as parameters. It works perfectly when only one file is involved, for example listing all transactions for a...
Eventually I found it. Sharepoint did not always tell Access that a field is required or read-only and it fails at the time the record is inserted. The fact that Sharepoint doesn't tell Access that it has failed seems to be ignored. Once I got the field values sorted it inserted the record...
Query qryInsertChild is a parameter query that reads one record from a table with a specific ID and inserts a record into the same table but with different dates. The ID is an auto number field and is the primary key. Running the query interactively prompts for three parameters, the ID and two...
...either.
Set qDef = db.QueryDefs("qryInsertChild")
qDef.Parameters("Master ID") = txtID
' Process all of the selected records
sSQL = "Select * From tblGenerated " & _
"Where User = '" & cSystem.WinUserName & "' " & _
"And Selected = True "
Set rst =...
Thanks Duane, that seems to have worked.
I change the AutoCorrect options on the back end as a performance aid but I don't usually bother to change the front end. It's strange that it should "correct" a field name to an incorrect name when it was correct in the first place.
PeteJ
(Contract...
I've got an Access front end that links to a Sharepoint back end. In the table one of the fields is called
[Requestor / Contact] - Note the spaces
When I use query designer to select this field and run it from within query designer it shows Okay. When I save the query it changes it to...
I tried changing the query to the base table but that did not help. Then I commented out all of the data setup stuff apart from the required fields and tried again. It successfully did the INSERT! I then went thru un-commenting the rest one by one. It did some Okay but failed on others where it...
...to be the way. I'm doing a simple loop around the existing data with AddNew/Update to write the record.
Set rst = db.OpenRecordset("Select * From tblLocalVersion Order By [ID]")
If rst.RecordCount > 0 Then
Set rstNew = db.OpenRecordset("qryAlternativeNew4", dbOpenDynaset)...
Ben
You were on the right line there.
I put a break point in Form_Current in one of the forms, made a change to the form (added a blank character to the code) and saved it. I then closed the database. I then went back in and when I opened the form it stopped at the point where I'd put the break...
Remembering an old break point seems likely. I had been checking that it ran through the code like I expected. I'll try the Compile/Compact&Repair option but how do I test that it works? [ponder]
It's not consistent so I won't know if it works because I've fixed it or because Access has decided...
I prefer Break in Class Module myself but break on unhandled has its uses too. My VBA is always well-written with error trapping showing what the error is and where it occurred. I very rarely use On Error Resume Next and certainly not in this case so if I temporarily comment out the On Error...
At times when my users are working with an Access application it jumps into the VBA code editor for no reason. I say no reason but really I mean I don't know why it does it. There are no errors, no break points, the user isn't debugging the code. In fact, when he sees the VBA behind the scenes...
Woops - typo time!
I just noticed that my reference to tblImport2 deletes it after it has finished. That is because I was importing the data from Excel and only needed the table until I had populated tblImport. You probably don't want to delete your table [bigsmile]
Also the last sentence...
I had exactly your problem. There were a few problems with character sets but the eventual approach was to create a table tblCharSet with all of the valid characters. I then created a work table with three fields
LineID Autonumber
Original Memo
Changed Memo
This concatenates the...
...FieldList(TableName As String) As String
Dim sSQL As String, sReturn As String
Dim rst As Recordset, i As Integer
sSQL = "Select * From " & TableName
Set rst = CurrentDb.OpenRecordset(sSQL)
With rst
' If the field name is always ID do it this way
For...
The class module raises the event. The variable oFileWatcher is defined as a variable in the General section of the form code. As long as you have defined oFileWatcher as WithEvents then all you need to do is kick off the file watcher and wait for the event to happen. As soon as the the form...
I take it you have created a class module called clsFileWatcher? You have defined oFileWatcher as a variable of type clsFileWatcher and I don't think there is any problem defining it as
Public WithEvents oFileWatcher As clsFileWatcher
in the form that is doing the work. Isn't that how the...
Woops, Biological Component Failure
Should have said "let the class call the form's procedure" instead of "let the form call its procedure"
PeteJ
(Contract Code-monkey)
It's amazing how many ways there are to skin a cat
(apologies to the veggies)
I think MajP's suggestion is definately the way to go. In the form you seem to want to tell the class which of the form's own procedures to call when it receives a file and let the form call its procedure. Better to have the class tell the form when it has received a file. A class is supposed to...
MajP
Going by the Litwin and Getz quote it seems that VBA converts the raw data to ANSI before placing it in a variable containing the SQL select command. End result is that the WHERE clause is incorrect. This must mean that passing the select string with rst.Fields("Actual") in the WHERE...
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.