Results 1 to 11 of 11
  1. #1
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    337

    Another odd error message keeps appearing

    I have added a Many-to-Many Relationship Field to a sheet named 'Reports'. This Many-to-Many Relationship field is named 'name_to_match_MMR'. I have a line of code in the scripting that simply clears this field ('Clear field (Reports: name_to_match_MMR'). Every time I try to run the code using the debugger, I get an error message saying "Script error on line 11: The action can only be executed only with the 'Reports' record type. Action: Clear field (Reports: name_to_match_MMR)". Why am I receiving this error? I already have a couple of MMR's on the form and they work fine; however, this one refuses to cooperate. I have tried multiple actions (although my BD skills are quite limited) to no avail... I am not understanding the error message because I am already using the 'Reports' record.

    Background: I have been stuck at this point for the last two days and I easily have 10 hours invested in trying to fix this one error. Nothing I have tried fixes this issue. What is wrong, what is the error telling me, and how can I fix this?
    Thanks,
    Daryl G

  2. #2
    Join Date
    Jul 2012
    Posts
    87
    Can you send screenshot of all that script.

  3. #3
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    337
    MacHeuS,
    Script is attached.
    Daryl G
    Attached Thumbnails Attached Thumbnails code.jpg  

  4. #4
    Join Date
    Jul 2011
    Posts
    137
    Daryl,
    Find the mistake highlighted in the screen shot attached.
    Attached Thumbnails Attached Thumbnails correct script.png  

  5. #5
    Join Date
    Jul 2012
    Posts
    87
    asokram's right. 'Clear field' command have to be out of 'For-Next' cycle.

  6. #6
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    337
    asokram and MacHeuS,
    I am sure that you two are right; however, it still does not work if I make your recommended correction (the same error still appears). Additionally, I lose the value of the variable ('individual_match') if I make that change.

    Due to my inexperience and lack of understanding of this program, I was forced to attempt a variety of possibilities in order to have the program 'grab' a single value from a Many-to-Many Relational Field. By assigning the variable 'individual_match' as I did produced each line individually as I think it is supposed to. I needed to have a single value so I could use that value in a query (when only one value appeared, the program worked perfectly but failed to work if two or more values were in the original MMR field).

    I am struggling so much with Brilliant Database. I cannot understand how things are supposed to work... You folks that have been using it for awhile often mention about how easy it is though I am not seeing this ease-of-use.

    Any more guidance will be appreciated since I have absolutely NO idea on how to proceed.
    Thanks,
    Daryl G

  7. #7
    Join Date
    Jul 2012
    Posts
    87
    Can you share database.

  8. #8
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    337
    MacHeuS,
    This is part of the same program that you helped me with earlier. The purpose of this program is to track an organization’s training. My latest problem involves the ‘Reports’ folder. This folder simply serves as a place to generate and look at reports. The first (and, so far, the only) report that I have included allows the user to select a single training course and then examine this course in three different ways: 1.) identifies employees who have been assigned this training course AND have completed this training, 2). identifies employees who have been assigned this course and HAVE NOT completed this training, and 3). identifies all employees that have completed this course regardless of whether or not it was assigned. The last two analyses (2 and 3) work fine; however, I am having a great deal of difficulty with the first analysis.

    I am getting the proper names to appear for the first option, but I also need for the dates of the training to appear (just like in option 3) - the upper MMR would reflect the values needed. Later, I will show/hide the appropriate MMRs based on rules for visibility… this much I can do. I added scripting that examines each candidate so that I could setup this as part of a query (this query would be recursive) and although the individual records appear, I still get those error statements and the upper MMR (‘name_and_date_MMR’) still does not populate. The query is using the 'Completed Training' folder and is named 'assigned_and_completed_query'. For an example, please select ‘SE-200’ as the course to examine. Next, select the ‘Required and Completed Selected Course’ - four people are assigned this course AND have completed it (Adams Joseph, Greene Daryl R, Johnson Greene Lynn, and MacHeuS – with respective file ID’s of 1064, 1114, 1301, and 2295). Just like with the third option, dates are needed whenever a training course has been completed… but I am unable to get the ‘name_and_date_MMR to work properly.

    In summary, the first option ('Required and Completed Selected Course') is the only area that I am experiencing trouble with. I cannot get the names ('employee) and date ('date_completed') to show up in the MMR named 'name_and_date_MMR'.
    Can you please help?
    Thanks,
    Daryl G
    Attached Files Attached Files

  9. #9
    Join Date
    Jul 2012
    Posts
    87
    Try file first. If cant open. Look screenshot. I did not use queries. I dont like queries. If I can, first I create recordset it contains all records in selected folder. And create second recordset for filtering this record. This do same job of queries. (Create recordset from filter another recordset. Used this for $required, $completed, $pull_from_completed)
    Attached Thumbnails Attached Thumbnails 001.PNG   002.png  
    Attached Files Attached Files

  10. #10
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    337
    MacHeuS,
    You were right, I could not open up the file you sent... I have yet another question for you. The first line of the scripting that reads: "[All_Emplo] = Folder "Employee Lists" content (Employee List)". I cannot find how to add that particular wording? I assume that I would go to 'Add Variable' but what do I select next ('Recordset, Folder ID). I tried each possible pathway and never could see anything that would allow me to replicate the line of scripting that you included in the first line.

    I, too, do not like the queries - these are just too awkward to attempt to use plus I still do not understand the how to set them up properly (it should be a simple concept but I am finding them to behave strangely or incorrectly). From the screen shots you attached, it looks as if you came up with exactly what I was looking for - You are awesome!!!

    Examining further, I need guidance on how you added lines 3 and 7 also as I have never seen this layout. I thank you for your help with this and I hope that you can tell me how to add the 1, 3, and 7 lines of script.
    Many thanks,
    Daryl G

  11. #11
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    337
    MacHeuS,
    Update: after several more tries I was finally able to get the file to open (am I the only one that experiences much difficulty when trying to open up downloaded files?).

    It works wonderfully!!! How can you figure out how to make this work? MacHeuS, I truly appreciate all of your help.
    Thanks,
    Daryl G

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •