Here is an old hack that invisibly selects the next record above or below the current selection and then back again which will update a matrix synced to the datasheet. Add this to your checkbox procedure.
Thanks, @gary. Tried the example both solo and with the other code, but looks like it’s the same behavior. I’ve now realized that clicking any other cell also updates the matrix, and I’m guessing that’s what the code you shared is “imitating” - just looks like it’s not working here.
But I’ll keep this cool trick in my back pocket - I’m sure it will come in handy. Thanks again.
There is an undocumented statement used by the Refresh tool bar item in graphics mode called refreshmatrixes. Jim noted in a previous post that this should probably work in data mode as well. It supposedly deletes all the matrix objects on the current form and redraws them new. I have not tried this so I can’t comment further on how fast or safe it might be.
Thank you, @gary. Tried it but no success. Also searched the forum and found the thread you referenced, tried a few suggestions from there, but I can’t seem to get it working. BTW - I realize I may be barking up the wrong tree if I’m using the matrix in an unintended fashion. But as always, I appreciate the guidance. Have a great night!
Thanks everyone for the tips. With some experimentation I figured out that adding this to the procedure pane of the checkbox did the trick:
uprecord
downrecord
Thanks to @gary for the idea to try “bouncing” around records. There’s a tiny flash now when the checkbox is clicked, but the field updates correctly and can be toggled on and off.
If anyone has any other ideas I’d love to hear them, but this is working good enough for me right now. Thanks everyone!
Well Biagio, the code I gave you previously is what I expected you to put where you just put the abbreviated code you just listed. My code added a couple of features you might want to incorporate. The first is to add the noshow/endnoshow/showpage to keep the datasheet from flashing at all. The second feature is to test to see if you are currently at the top record of the datasheet so you would have to go down a record and then back up. In all other cases you would go up a record and then back down. In you simple code nothing will happen if you are currently on the first or top record.
I replied to this thread twice from my email, but that no longer seems to be working so I am replying from the discussion forum.
This is very crude, but it can work to redraw a matrix or maybe it was a text list (worth a try). Put this in the procedure pane of your checkbox or call a procedure with the code at the end.
formtographicsmode
formtodatamode
You could also try this if the page blinks:
noshow
formtographicsmode
formtodatamode
showpage
Also, I believe in Gary’s post,
if info(“bof”)
downrecord
uprecordName
uprecordName is a typo. It should be uprecord. Is that right Gary?
Error indeed - don’t have any idea how that got included and I hadn’t noticed myself. I have edited the original post to remove it. Thanks for catching that, it was probably the reason Biagio couldn’t get it to work initially.
Thanks for the clarification @gary, I had put uprecordName in there, so that was the holdup. I’ve tried the code again changing it to “uprecord” and it works perfectly, no flashing, feels totally seamless. Thanks!
Thanks @JeffK - tried this and it worked with a tiny “glitch” but was totally acceptable (if the inspector was open it would flash in and out), but your catch on the uprecordName was really helpful. I’m still too new to have realized it was a typo. Using that approach has now proved seamless. Thanks for the guidance, and for trying two emails first