Results 1 to 15 of 15
  1. #1
    Kohl is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2012
    Posts
    9

    Error message when trying to use custom Macro

    Hello All,

    This is my first post here, and I am posting on behalf of a co-worker. Please forgive me if I don't know the answer to any additional questions you may have as I do not use Access on a daily basis.

    It is my understanding that a custom macro was built to pull text data from a file and import it into Access in the appropriate fields. This macro no longer works and will return the following error message:

    "License information for this component not found. You do not have an appropriate license to use this functionality in design mode."



    It only gives an option to click OK. When you do it shows a box called "Action Failed" that lists the macro name, condition, action name, and arguments with three button to click on the right of the box: "Step" "Halt" and "Continue". It appears that only the "Halt" button is available to be clicked.

    Does this sound like an issue with the Access license or whatever license the macro might have? We're trying to decide if it's possible to restore the functionality of the macro. Any advice you may have would be great. Thanks!

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Would it be possible for you to post the Database and the text file?

  3. #3
    Kohl is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2012
    Posts
    9
    Quote Originally Posted by Robeen View Post
    Would it be possible for you to post the Database and the text file?

    Forgive my n00b-ness, but what exactly do you want to see?

  4. #4
    Kohl is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2012
    Posts
    9
    I suppose I should have said in my original post that we're not certain if the macro still exists. If you're asking for the text file of the macro, I cannot provide it because we don't know where it is (if it's even there).

  5. #5
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Quote Originally Posted by Kohl View Post
    Forgive my n00b-ness, but what exactly do you want to see?
    I was asking if you could post a copy of the database [the Access file that is giving you the error].

    That Macro or Action . . . is getting triggered somewhere - right?
    Then, when it is not able to run - for whatever reason - it throws up the error box that you described in your first post.
    Can you tell me exactly what is being done with Access to cause the error that you are seeing?
    I'm looking for a way to help you solve your problem - so the more information you can give me, the better the chance that we will be able to figure out the issue.

    Is someone there using the Access database on a regular basis? I mean - opening it up in 'design mode' to work on it - make changes etc?

  6. #6
    Kohl is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2012
    Posts
    9
    Are you looking for the .mdb file? Even when I compress the file it's too big to attach.

    Basically, the user is just clicking on a button in the data entry form labeled "Update CRC/Chucksums from Log" which should activate the macro. Instead it displays the error message.

    Yes there are people here who use the access database on a regular basis. I'm just not one of them. I'm trying to figure out this problem for them, so they don't have to use time to dig into it themselves. I'm sorry I can't be more helpful. If you have questions I can bring to someone who knows more about access and the database, I'll do my best.

  7. #7
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Ok . . . can you open the mdb in design mode?
    If so:
    1. Locate the data entry Form which has the said button
    2. Select & Right-Click the button & then 'View Code'. [OR - select the button -> Properties -> Events -> On Click -> View Code.
    3. Post the code behind the button here for us to look at it.

  8. #8
    Kohl is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2012
    Posts
    9
    Code:
    Public Function update_from_logfile()
        Dim appAccess As Access.Application
        Set appAccess = CreateObject("Access.Application.9")
        Dim stLogFileName As String
        Dim intIdx, i As Integer
        Dim stKeyword1, stKeyword2 As String
        Dim logfile, filesys
        Dim datetimeRec, h14Rec, h15Rec, h30Rec, h31Rec, valCRCRec As String
        Dim logrec As String
        ' This function updates the checksum and CRC values from the VHLC program log files for the
        ' record currently displayed in the form.
        ' First initialize some variables to use for the search.
        ' Get the fully-qualified vital log file name from the form values.
        stDirFileName = Trim(Directory_File_Name)
        ' The dir path name may or may not contain a trailing "\", so add it if it needs to be added.
        If Right(Directory_File_Name, 1) <> "\" Then
            stDirFileName = stDirFileName & "\"
        End If
        stLogFileName = stDirFileName & Vital_File_Name & ".log"
        ' Make sure the log file exists first.
        Set filesys = CreateObject("Scripting.FileSystemObject")
        If filesys.FileExists(stLogFileName) Then
            Reset
            ' Open the file for input
            Open stLogFileName For Input As 1
            ' Get the last H14, H15, Validation CRC and compile date/time entries in the file.
            Do While Not EOF(1)
                Line Input #1, logrec
                If InStr(logrec, "compiled") > 0 Then
                    datetimeRec = logrec
                Else
                    If InStr(logrec, "Checksum") > 0 Then
                        If InStr(logrec, "IC14") > 0 Then
                            h14Rec = logrec
                        Else
                            h15Rec = logrec
                        End If
                    Else
                        If InStr(logrec, "Validation CRC") > 0 Then
                            valCRCRec = logrec
                        End If
                    End If
                End If
            Loop
            ' Update the Vital compile date.
            If Len(Trim(datetimeRec)) > 0 Then
                Date_Vital_Created.SetFocus
                Date_Vital_Created.Value = Mid(datetimeRec, (InStr(datetimeRec, "System compiled") + 16), 11)
            End If
            ' Update the H14 CRC and Checksum.
            If Len(Trim(h14Rec)) > 0 Then
                Vital_CRC.SetFocus
                Vital_CRC.Value = Mid(h14Rec, (InStr(h14Rec, "CRC") + 4), 4)
                Vital_Checksum.SetFocus
                Vital_Checksum.Value = Mid(h14Rec, (InStr(h14Rec, "Checksum") + 9), 4)
            End If
            ' Update the H15 CRC and Checksum.
            If Len(Trim(h15Rec)) > 0 Then
                Vital_CRC_2.SetFocus
                Vital_CRC_2.Value = Mid(h15Rec, (InStr(h15Rec, "CRC") + 4), 4)
                Vital_Checksum_2.SetFocus
                Vital_Checksum_2.Value = Mid(h15Rec, (InStr(h15Rec, "Checksum") + 9), 4)
            Else
                ' If the H15 record does not exist, set the H15 values to blank.
                Vital_CRC_2.SetFocus
                Vital_CRC_2.Value = " "
                Vital_Checksum_2.SetFocus
                Vital_Checksum_2.Value = " "
            End If
            ' Update the Validation CRC.
            If Len(Trim(valCRCRec)) > 0 Then
                Validation_CRC.SetFocus
                Validation_CRC.Value = Mid(valCRCRec, (InStr(valCRCRec, "CRC") + 6), 8)
            End If
            ' Close the file.  We're done with the vitals.
            Close 1
        Else
            MsgBox "Vital Log File " & stLogFileName & " not found."
        End If
        ' Now get the NONVITAL log file values.
        ' Initialize the variables being reused.
        datetimeRec = ""
        ' Format the nonvital log file name.
        stLogFileName = stDirFileName & Non_Vital_File_Name & ".log"
        ' Check to see if the nonvital log file exists.
        If filesys.FileExists(stLogFileName) Then
            Reset
            ' Open the file for input
            Open stLogFileName For Input As 1
            ' Get the last H14, H15, Validation CRC and compile date/time entries in the file.
            Do While Not EOF(1)
                Line Input #1, logrec
                If InStr(logrec, "compiled") > 0 Then
                    datetimeRec = logrec
                Else
                    If InStr(logrec, "Checksum") > 0 Then
                        If InStr(logrec, "IC14") > 0 Then
                            h30Rec = logrec
                        Else
                            h31Rec = logrec
                        End If
                    End If
                End If
            Loop
            ' Update the NonVital compile date.
            If Len(Trim(datetimeRec)) > 0 Then
                Date_Non_Vital_Creat.SetFocus
                Date_Non_Vital_Creat.Value = Mid(datetimeRec, (InStr(datetimeRec, "System compiled") + 16), 11)
            End If
            ' Update the H30 CRC and Checksum.
            If Len(Trim(h30Rec)) > 0 Then
                H30_U10_CRC.SetFocus
                H30_U10_CRC.Value = Mid(h30Rec, (InStr(h30Rec, "CRC") + 4), 4)
                Non_Vital_1st_Checks.SetFocus
                Non_Vital_1st_Checks.Value = Mid(h30Rec, (InStr(h30Rec, "Checksum") + 9), 4)
            End If
            ' Update the H31 CRC and Checksum.
            If Len(Trim(h31Rec)) > 0 Then
                H31_U9_CRC.SetFocus
                H31_U9_CRC.Value = Mid(h31Rec, (InStr(h31Rec, "CRC") + 4), 4)
                Non_Vital_2nd_Checks.SetFocus
                Non_Vital_2nd_Checks.Value = Mid(h31Rec, (InStr(h31Rec, "Checksum") + 9), 4)
            End If
            ' Close the file.  We're done.
            Close 1
        Else
            MsgBox "Nonvital Log File " & stLogFileName & " not found."
        End If
    End Function
    I think this is it.

  9. #9
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    I just read back to your original post because it seems like we drifted away from what you originally said:
    "License information for this component not found. You do not have an appropriate license to use this functionality in design mode."
    It only gives an option to click OK. When you do it shows a box called "Action Failed" that lists the macro name, condition, action name, and arguments with three button to click on the right of the box: "Step" "Halt" and "Continue". It appears that only the "Halt" button is available to be clicked.
    Have you looked at the particular Macro that has to be halted?
    Can you post a screenshot of the Action Failed box?
    Is it failing on the call to the function that you gave me the code for?

  10. #10
    Kohl is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2012
    Posts
    9
    Click image for larger version. 

Name:	untitled.jpg 
Views:	2 
Size:	25.0 KB 
ID:	7975

    Click image for larger version. 

Name:	untitled2.jpg 
Views:	3 
Size:	77.5 KB 
ID:	7976

    I don't know why these are showing up so small.

    It's calling "update from logfile" a macro but the only code visible for it is shown as a function (what I posted above). Could that be the problem? I would assume that it's failing while trying to run this function, but I'm not entirely sure.

    I'm sorry I'm so not-helpful. Thank you for trying.
    Attached Thumbnails Attached Thumbnails untitled.JPG  

  11. #11
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    It's getting to where having a copy of the database would really help.
    Can you tell me how that Macro gets 'called'?
    Do you have a Macro called 'AutoExec'?
    Can you not make a stripped-down version of the database - with minimal data - that we can look at here?
    This looks like it needs some 'de-bugging' and that would go a lot quicker if either someone at your operation knew how to go about it - or you could let us look at it here.

  12. #12
    Kohl is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2012
    Posts
    9
    I found another file that looks like a smaller version of the database. See if this helps.project_2006-04-11.zip

  13. #13
    Kohl is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2012
    Posts
    9
    Oh, to get to the screen with the button you have to select "enter programming data", "programmers access", "enter site info" once the database is open. That will bring you to form view. To find the code I had to switch the view to design mode, select the button, and then select code from the "view" drop down menu.

  14. #14
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    I have to admit . . . I am out of my depth as to why that error is popping up.

    Since the version you posted does not have the function code in it, I pasted in the code for the function you gave me earlier but I get the same error you get 'License . . .'.
    I'm not sure what other code is on your version of the DB in the Modulethat has that function.

    The only way I could prevent that error was to create a new Form . . . and then run the function from there.

    I am not sure - since I am running Access 2010, what issues are version-related, and what are just plain errors.
    Sorry I can't help. I would have to be doing this full time to be able to get to the bottom of it.

    Did you by any chance get a new version of Access . . . or a new version of Windows on the machines on which this database is being run?
    I had a few problems with an Access 2008 project I was on when the company changed the operating system on the development laptop and I had to go in a few weeks after the project was done and make some changes.

    If you don't hear from anyone else here - re-post and include a link to this thread.
    Sorry I can't spend more time on this!
    All the best.

  15. #15
    Kohl is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2012
    Posts
    9
    Thanks anyway. This was just a shot in the dark to see if anyone had run into this problem before. I appreciate your effort.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 03-25-2012, 01:53 PM
  2. Replies: 3
    Last Post: 07-04-2011, 02:44 AM
  3. Custom validation error message
    By snorkyller in forum Access
    Replies: 2
    Last Post: 03-21-2011, 03:40 PM
  4. Custom error message problem
    By thekruser in forum Programming
    Replies: 10
    Last Post: 10-06-2010, 05:14 PM
  5. Creating a *Good* Custom Message Box
    By Jerimiah33 in forum Forms
    Replies: 1
    Last Post: 11-09-2005, 04:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums