Not played with Access in a while, plus I have a memory like a sieve, but is the reference to rs within the "With" block necessary ?
Dim rs As DAO.Recordset, db As DAO.Database, SrchCrit
Set db = CurrentDb
Set rs = db.OpenRecordset("tblEngagements")
DoCmd.RunCommand acCmdSaveRecord...
Not sure about running a query in one Access db from another Access db, but I have run code in an Access db from a VB6 app. The code, I think, may at least give you some pointers...
Dim acMyApp As Access.Application
'Create an instance of Access.
Set acMyApp = New Access.Application
'Set...
Or, for completeness...
Test Sub()
On Error Goto ErrorTest_1
'Your code here
Exit Sub
ErrorTest_1:
Select Case Err.Number
Case 3274
MsgBox "This excel file has been changed to by someone; the columns don't match the table it goes into." & vbCrLf & vbCrLf & "Error Number " &...
I've not read any other threads on this topic (I usually lurk around the VB6 forum), so I'm not sure what's already been discussed, but I've had experience of this "2501 - The Open Report Action was Cancelled...", and it drove me up the wall because nothing seemed obviously wrong.
My "solution"...
My method of updates is for my app to check the date of creation of the version held on the server at start up. If it's different from the local version then it opens a batch file and closes itself down.
The batch file then copies the new version to the local machine, overwriting the original...
Ok, this should be pretty straight forward, you'll need to set a reference to the "Microsoft Office 11.0 Object Library".
Choose "Tools" from the menu bar and then "References". A References dialog box will appear. Scroll down the list until you come across the library above and put a check in...
Have a look at the FileDialogue box in help.
I don't have any code handy, but using this your user(s) should be able to browse to the file (whatever it's name) to be imported. You can then determine the name of the file selected, and import the data.
Hope this helps.
You might be better off posting this in the VBA forum.
However, I had a similar problem not so long ago - the mailing, not the printing.
I (not being a Word expert) ended up saving the document to the C drive of the local machine and then attaching it to the outgoing mail. You could then...
Quite a while since I've used Access so I could be barking up the wrong tree here but, I think you'd need to use your own menu bar rather than the Access default.
have the print option in your own menu bar and capture that event.
Dim varBatchFile
Make the check to see if the file needs updating, if it does then...
varBatchFile = Shell("[pathway to batch file]")
Quit
To ensure that the batch file allows the time required for Access to shut down, place a Pause withing the batch file before the copy occurs.
Once...
A simple solution that I use is for the app to check the date/time stamp on the local exe file and compare it to the master file on the server.
If it's different then it closes itself down immediately after opening a batch file. The batch file replaces the file on the workstation with the one...
You could try...
Dim wdMyApp As Word.Application
Dim wdMyDoc As Word.Document
Set wdMyApp = New Word.Application
Set wdMyDoc = wdMyApp.Documents.Add("[Pathway here to your template]")
wdMyApp.Documents(wdMyDoc).Activate 'Make the word doc Active
'
'
'Do whatever you need to...
Thanks for the advice guys.
Because of the urgency of the project I'm working on, I think I'm going to write this current project in VB6. And then look at rewriting in dot NET at a later date, when time isn't too much of a factor.
Thanks again.
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.