I have a bat file set-up to run at set time every morning on my scheduled tasks. The code in the bat file is as follows:
START "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "H:\Service Centre\DataTeam\AccessDatabases\dbautomation.mdb"
i've been having a few glitches with it. On...
Hi
That didn't work, but managed to fix it by replacing it with:
Dim olMail as Variant
it was because the sent-items folder contains more than just mail items (appointments, calendar tasks etc.).
It all works now!
Hi
I get the following error on the highlighted line of code...trying to run this to delete certain items out of my sent items folder after running some batch reports. Running this on access 97
The error is:
Run Time Error 13 'Type Mismatch'
I thought it might be because olMail hasn't been...
Hi
I'm using a Pass-through query in Access 97 (i know, old version!!) to get data out of an ODBC database.
The problem is, the database has over 250 fields so I cannot get all the data using a standard link-table in access, & as a result, I don't know the ODBC field headers for the data i need...
I have some code that is exporting a query to excel & then formatting it. I am having a few issues here...if i try to reference the highlighted line to 'objex' i get the above error and it won't run, but if i don't reference it then excel remains running in the background and the workbook...
nope. this code is running off a form that has two text boxes - year & week. that is where those bits of info are coming from.
does it matter what references i have running?
sorry, did the highlighting incorrectly...it should be on this line:
objex.Workbooks.Open "H:\Service Centre\Reports\Wkly Reports\" & Year & "\wk" & " " & WeekNumber & "\RWAReportwk" & WeekNumber & ".xls"
Hi
i posted a problem i was having with this code last week - when i ran it the first time it ran ok, the second time i got the above error.
I got some new code and pasted it in & it worked fine. I have now come to run it again today, and on the first run I am getting the above error on the...
Yes, i am running access 97...oh lucky us...
tried the docmd.runsql statement and came across a couple of issues (code below)....
1) When i clicked on the button, it asked me to enter criteria for the user name, rather than taking it from struserid
2) I cannot get it to identify with a set...
Ok, here is the code i have:
Private Sub Command26_Click()
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
On Error GoTo Err_Command26_Click
If Nz(StoreInvoiceNumber, 0) = 0 Then
MsgBox "Please enter invoice number"
Else
With rst
.ActiveConnection =...
Stupid question number 37 this week!!
I have a form with an unbound text box - this text box is updated on form open with the below code:
Private Sub Form_Open(Cancel As Integer)
DoCmd.SetWarnings False
Dim struserid As String
struserid = Environ("UserName")
Me.UserName = struserid
End Sub...
Hi
Thanks for the responses, tried the first code but couldn't get it to work.
Copied PH's code in place of mine & now it works everytime, like a charm!
Thanks guys!
Hi
I'm running a piece of code that extracts a query to excel, formats & then mails it out.
The first time I run the report it works fine, but the second time i get the above error.
I have figured out why...excel is still running in the background & if i go to task manager and end the .exe...
The form is called frmRWAReport
The unbound text field is called WeekNumber
There is also a 'Submit' button
The code currently is:
Dim mystring As String
DoCmd.OpenForm "frmRWAReport"
mystring = "frmRWAReport[WeekNumber].Value"
'Export the report.
DoCmd.TransferSpreadsheet acExport...
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.