Results 1 to 14 of 14
  1. #1
    DevilDawg is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2023
    Posts
    11

    Question Continious Form issue


    I am attempting to create an app for my own use that I can keep track of items purchased as well as how I rate the product in various categories. The issue I am having at this time is with the rating system. I have imported roughly 200 plus reviews I have completed so far. When the sub form loads, it correctly brings in the selected categories, but the stars show each category to be the rating of the last loaded. as you can see in the attached photo, the textbox at the end of the row is the actual rating I gave for that category, but the stars do not match. I even went further and added 5 separate Boolean fields to represent the respective star to either be on or off but am getting nowhere. I've tried several different VBA routines to attempt to change them on load. If tried, as recommend on another posting to add an IIF in the control source but it did nothing either. I'm really not sure what the issue is. This so far is primarily on the onload are and am sure I am going to have some issue later one, once I get in to the editing of the record. That will probably have something to do with referencing the row, but I will cross that bridge once I get there. I just need to get them loading correctly for now.

    I am in unfamiliar territory at this point and, after all the things I have done with VBA programming, am admitting defeat. I need help and am humbling asking all you out there if there is some solution you know of or have actually done. If anyone can help with code and an explanation or links to something that address this particular issue. Any enlightenment and assistance you can give is greatly appreciated

    -Chuck

    Click image for larger version. 

Name:	app issue.png 
Views:	29 
Size:	32.3 KB 
ID:	51036

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Are these stars images? What is the code that sets their display?

    I am sure this has been done before but we need to know more about your situation.

    Could provide db for analysis. Follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    Just asking but why do you need the stars? Can't you just go with the count in the box?

    But if you need the stars, like June7 asked how are the those images done? Do you have 5 images to use (1star marked, 2 stars, etc.)? Also you said Continuous forms, so do you have multiple records on the subform?

    Just to take a shot, I would think you would have code behind the box with the value to use "afterupdate" If value = 5, display the "5l Stars" images for that field, etc.

  4. #4
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    If tried, as recommend on another posting
    You have posted this question elsewhere and we could take a look?
    EDIT - I think you only need one field that holds the number (e.g. 5). If you're using image controls for the stars (1 for each star) I suspect that control has the tag property. I"d tag them 1 thru 5 and set whatever property you use to show them as yellow if the tag <= the number. So for rating 3, controls with tags 1,2 and 3 would show yellow.

    EDIT2 (edited) Thought image control didn't have tag property but it's on the "Other" tab of the property sheet.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    DevilDawg is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2023
    Posts
    11
    Yes, the stars are two seperate images and there are 5 imageboxes. so 10 possible options. Star 1 can be on or off, star 2 can be on or off, etc... The images, initially are embedded, then they are changed using the ".picture=" property. If absolutely needed, I can rip all my other code out as there is a lot of code already done but I won't be able to provide but just a few data entries. I am sure, as well, that it has been done before and it's probably going to be something very simple in the end. One of those head slapping moments.

  6. #6
    DevilDawg is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2023
    Posts
    11
    I was trying to make it look nice, incase later on I decide to sell it to the community it is geared for. I only use 2 images; either on or off and their are 5 different pictureboxes. Right now I have around 250 records. So, if I open the form alone, it displays all them but the main form is linked via a Unique ID to limit what is shown in the subform to only those pertaining to the main record. Yea, there is back end code for onclick for upgrade but that updates all 250+ records to what I selected and not just that one. I am thinking I need to reference the specific line but my brain is fried at the moment.

  7. #7
    DevilDawg is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2023
    Posts
    11
    posted elsewhere? This is my first time posting I think. I know I have had an isue for quite some time. It's not a primary job related so I guess it is possible. Do you have a link to the other?

  8. #8
    DevilDawg is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2023
    Posts
    11
    To provide a little more here is the subform in edit mode:
    Click image for larger version. 

Name:	raw subform.Edit.png 
Views:	27 
Size:	5.5 KB 
ID:	51038

    Here is it Live:
    Click image for larger version. 

Name:	live.png 
Views:	27 
Size:	134.8 KB 
ID:	51039

    As you can see, in the live mode, all the stars are in the off position as the last record loaded isn't rated so it updated all the records to off. Further to the right you can see the fields that will later be hidden but they are, after the stars, the over al rating, then the ID for the category that i have marked through, ID to two other tables. Then you have the checkboxes. These checkboxes were added yesterday in an futile attemple to try to tie them somehow to the stars to on or off.

  9. #9
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    I still think using the Tag property is the way to go:
    - start with all images being stars with no background colour
    - in form current event, loop over form controls
    - if control type is an image control and CInt(control.Tag) <= rating textbox (which I presume is number data type) Then .picture property = SolidStar.jpg

    Not sure if that would cause screen flicker or not so maybe turn off/on screen updating (Application.Echo) but use an error handler to ensure it doesn't remain turned off.

    Maybe someone will have a better idea. Embedding the images might help also, although I don't usually do that so if you can swap embedded images that would be interesting. An alternative might be to make SolidStar image control visible and the other not, but that would require 10 image controls (5 non-filled laid on top of 5 filled). Might eliminate screen flicker if that was an issue though.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  10. #10
    DevilDawg is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2023
    Posts
    11
    Thanks, Micron. I did set all 5 imageboxes tag to 1 through 5 respectfully. I will write the code in the next day or two and get back

  11. #11
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    you actually have 6 states - no stars to 5 stars because star2 cannot be true unless star1 is also true

    there are a number of ways to do this but see the attached example

    1. I've stored the star images in msysResources as 'star-1' and 'star0'
    2. In the table I just store the 'score'
    2. see the form recordsource for how to determine which image to show for each 'star'
    Attached Files Attached Files

  12. #12
    DevilDawg is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2023
    Posts
    11

    Cool Figured it out

    Alrighty, I resolved it. It's been a long time coming. On the continuous forms query, I created 5 fields; Star1, Star2, Star3, Star4 and Star 5. In those 5 fields, I used an iif statement; for star1 the iif statement was
    Code:
    star1: IIf([Rating]>=1,"C:\Program Files\Amazon Vine\images\fstar.png","C:\Program Files\Amazon Vine\images\ostar.png")
    . For star 2 through star 4, I changed the iif statement to reflect greater than or equal to the rating and I just put =5 on star 5. I then set the "Control Source" of the 5 separate stars to the corresponding star I set in the query.

    For now, it is working. I appreciate everyone's input and thank you for challenging my mind. This has been an unresolved issue, for me, for quite some time and so glad to see it come to an end. Now, I will get it set to where myself, or someone else, can choose a different set of images for selected and not selected. Also, I have to find a way for someone to be able to change the rating as well as add a row. That should be easy from this point.

    Again, thank you for everything, I will do my best to be as active in here as time will permit. Hope I can help someone down the road.

    -Chuck

  13. #13
    DevilDawg is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2023
    Posts
    11
    CJ_London, Sorry, I replied before i checked your solution. You did exactly what I did. Thank you for the solution, my Friend.

  14. #14
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    just as an aside - unless you are planning to use this to set the number of stars by clicking on one of them I think it would have more impact to just to show the 'full' stars and not the empty ones.

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

Similar Threads

  1. Replies: 25
    Last Post: 11-17-2023, 08:53 AM
  2. Continious form
    By sharif.azimy in forum Forms
    Replies: 1
    Last Post: 09-12-2019, 08:10 PM
  3. Compare records on continious form?
    By Aweiher in forum Forms
    Replies: 21
    Last Post: 03-14-2016, 12:31 PM
  4. Replies: 1
    Last Post: 08-19-2011, 02:53 PM

Tags for this Thread

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