- Save the database in a hidden shared folder (using a $ after the share name means it cannot be found unless you know what it is)
- Write an autoexec macro/startup form that runs a docmd.quit unless you have set a command line flag (i'll let you google that if you dont know of it, but essentially, you create a shortcut with /cmd "letmeinple ase"
User Profile
Collapse
-
Hi, i will share with you some of the things i do with my back end databases, you might find them useful you may not... -
****FACEPALM*** *
Another invalid reference issue... i had tried to to hard code it elsewhere to change the Excel reference (to decide which version to use) but gave up and decided to remove the excel code and the reference, but this code remained and re-referenced it, thats what ya get for coding overnight.Leave a comment:
-
More problems RE: 2003>2010... grrr
Hello again,
Im still trying to iron out the bugs in my previous programs (without too much effort),
The following code doesnt appear to be working in the Access 2003 MDE file when used with the Access 2010 Runtime environment, can anyone spot why?
The code is used to populate a custom "Switchboar d" type main menu, which shows the buttons based on logon data, problem is only one box is shown... -
Thanks again fellas, i must admit i do like to keep my code nice and tidy.
However, i'll give it a try, and if it becomes to tedious, ill just remove it and have a seperate version for PC with excel installed.
Ill let you know how i get onLeave a comment:
-
Thanks for the advice Stewart, i'm not entirely sure what you mean by early/late bound, unless you just mean referenced, or not (and then referred to in the function?
Here is an example of my code:
Code:Function ExcelATE(qryName As String, var As Byte) On Error GoTo Trap Dim fn As String, xlApp As Excel.Application, xlBook As Excel.Workbook, x As Long, y As Long, z As Long If MsgBox("Would you
Leave a comment:
-
Yeah, I thought I was clutching at straws a bit! Looks like its the hard way again!!
Unless its possible to deactivate code on the fly? Which sounds just as ludicrous!!Leave a comment:
-
I thought about that, but the file referenced is excel.exe itself, so I imagined, it wouldn't work, but I could tryLeave a comment:
-
How to handle a missing VBA reference (To Excel)
Hi guys,
I am in the process of migrating some access projects to 2010 (from 2003) and have hit another problem,
The background: we have upgraded some PC to office 2010, but not all, and some have had office removed (and we are using the viewers and access runtime).
Problem: in one project i have a reference to Excel (11.0) so that i can export some things straight to excel, now if excel isn't installed,... -
Hi guys, i think i have got it,
Code:SELECT MaxDates.StaffID , [Forename] & ' ' & [Surname] AS Name , MaxDates.MaxDate FROM [SELECT tblAppraisal.StaffID , MAX(tblAppraisal.Date) AS MaxDate FROM tblAppraisal GROUP BY StaffID]. AS MaxDates INNER JOIN (tblStaff INNER JOIN tblAppraisal ON tblStaff.StaffID = tblAppraisal.StaffID) ON (tblAppraisal.StaffID
Leave a comment:
-
Thanks for the tip Rabbit, I'll give it a whirl tomorrow and post my resultsLeave a comment:
-
Thanks again NeoPa, and Rabbit
I did as you both suggested, created a query to use as the sub query, but I can't figure out how to link StaffID between them or to return it as a field from the subquery in my example above. HmmmmmmLeave a comment:
-
Hello again, tried it a different way which might be more appropraite... but still doesnt work as planned:
Code:SELECT tblAppraisal.AppID , tblAppraisal.StaffID , [Forename] & ' ' & [Surname] AS Name , [B](SELECT Max(tblAppraisal.Date) AS MaxOfDate [/B] [B]FROM tblStaff [/B] [B]INNER JOIN [/B] [B]tblAppraisal ON[/B] [B]tblStaff.StaffID [/B] [B]= tblAppraisal.StaffID) AS Dat[/]
Leave a comment:
-
Hi, i've never used a sub query, ive just done some googling... quite complicated? or just me? lol
anyways, i tried to add a Date expression field with the following SQL:
Code:WHERE Date = (SELECT tblAppraisal.StaffID, Max(tblAppraisal.Date) AS MaxOfDate FROM tblStaff INNER JOIN tblAppraisal ON tblStaff.StaffID = tblAppraisal.StaffID GROUP
Leave a comment:
-
Help with max function in group by query... possible?
Hi guys,
It has come to my attention (thanks NeoPa), that i was doing something wrong...
i have a table of appraisal dates, stored as such
Code:tblAppraisal AppID, Auto, PK StaffID, Num, FK - Linked to tblStaff AppMan, Num, (FK) - uses a different StaffID from tblStaff table, but is not linked (lazy? lol) it indicates the Staff Member responsible for the appraisal Date, D/T
-
I will put it in a new thread as you request, i will do that soon (nearly hometime).
Well i found from that link (from my post #8) that the MSCAL.OSX function/feature has been been specifically removed from 2010 to allow for their date selector tool (which i havent tried).
I doubt that any of the functions were particularly affected, and up until that break in the code i dont think it was even used (its just...Leave a comment:
-
NeoPa (et al), i have solved the problem, (apart from the obvious MAX logic you pointed out), and it was to do with the MSCAL.OCX file, i checked the reference again, and it was pointing to the C:\program..... ...\office11\.. ..
Office 11 as you will know will not exist on a 2010 install
i had repointed it to the network location within the MDB from 2010, but everytime i re-made the MDE on another PC (in 2003) it adjusted...Leave a comment:
-
Just tried (with your SQL from #13), now in the MDE i get the same error, but with the reduced parameters
Code:Function is not available in query expression '(((tblAppraisal.Date<DateAdd('yyyy',-1,Date()))'
Leave a comment:
-
The error only occurs in the MDE file, and only if the MDE file is run in 2010, the MDB file works in all versions, and the Same SQL as a new Query also works and returns results.
As i see it, if grouping by date, it will list all the variable dates, if selecting the Max of date, and then grouping, i will only get one date, the maximum, and that also appears to work as expected.
As above, the problem is only with...Leave a comment:
-
Hello again,
I have just tried the SQL as a new Query, and it works error free (in the MDB, 2010), i used MAX because in the lookup table there can be multiple dates per StaffID and i wanted the last one.
Code:tblAppraisal: AppID, Auto, PK StaffID, Num, FK AppMan, Num, FK Date, D/T
Leave a comment:
-
Noted, sorry again NeoPa, what do you think to the invalid reference theory i suggested? i havent tried it yet because it would mean quite a few UserForm modifications.Leave a comment:
No activity results to display
Show More
Leave a comment: