User Profile

Collapse

Profile Sidebar

Collapse
Dan2kx
Dan2kx
Last Activity: Feb 25 '13, 06:40 PM
Joined: Oct 10 '07
Location: Hull,UK
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Dan2kx
    replied to Back End DB security doubt
    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...
    1. 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)
    2. 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"
    ...
    See more | Go to post

    Leave a comment:


  • Dan2kx
    replied to More problems RE: 2003>2010... grrr
    ****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.
    See more | Go to post

    Leave a comment:


  • Dan2kx
    started a topic More problems RE: 2003>2010... grrr

    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...
    See more | Go to post

  • 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 on
    See more | Go to post

    Leave 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
    ...
    See more | Go to post

    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!!
    See more | Go to post

    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 try
    See more | Go to post

    Leave a comment:


  • Dan2kx
    started a topic How to handle a missing VBA reference (To Excel)

    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,...
    See more | Go to post

  • 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
    ...
    See more | Go to post

    Leave a comment:


  • Thanks for the tip Rabbit, I'll give it a whirl tomorrow and post my results
    See more | Go to post

    Leave 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. Hmmmmmm
    See more | Go to post

    Leave 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[/]
    ...
    See more | Go to post

    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
    ...
    See more | Go to post

    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
    ...
    See more | Go to post

  • Dan2kx
    replied to 2003 - 2010 MDE problems
    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...
    See more | Go to post

    Leave a comment:


  • Dan2kx
    replied to 2003 - 2010 MDE problems
    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...
    See more | Go to post

    Leave a comment:


  • Dan2kx
    replied to 2003 - 2010 MDE problems
    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()))'
    ...
    See more | Go to post

    Leave a comment:


  • Dan2kx
    replied to 2003 - 2010 MDE problems
    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...
    See more | Go to post

    Leave a comment:


  • Dan2kx
    replied to 2003 - 2010 MDE problems
    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
    See more | Go to post

    Leave a comment:


  • Dan2kx
    replied to 2003 - 2010 MDE problems
    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.
    See more | Go to post
    Last edited by NeoPa; May 5 '12, 02:54 PM. Reason: Removed unnecessary quote.

    Leave a comment:

No activity results to display
Show More
Working...