Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 04-04-2019, 12:53 PM   #16
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 10,931
Thanks: 114
Thanked 2,990 Times in 2,719 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Repeated rebuild of right-click menu throws error

There is no objection to cross posting providing you follow the guidelines
Please read https://www.excelguru.ca/forums/show...-cross-posters

I am suggesting cascading combos as an alternative that will work without crashes. Your solution sounds neat but is no longer working...at the moment anyway.
I agree that combos will need a few clicks but I've used them in multiple apps and they work well.
You could look at my cascading combos example which has five of them http://www.mendipdatasystems.co.uk/c...xes/4594455723

BTW I do know about lichens and how they are used as a pollution indicator

__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin (Mendip Data Systems)
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 04-06-2019, 03:40 AM   #17
Petr Danes
Newly Registered User
 
Join Date: Aug 2010
Posts: 48
Thanks: 0
Thanked 1 Time in 1 Post
Petr Danes is on a distinguished road
Re: Repeated rebuild of right-click menu throws error

Quote:
Originally Posted by isladogs View Post
I am suggesting cascading combos as an alternative that will work without crashes. Your solution sounds neat but is no longer working...at the moment anyway.
I agree that combos will need a few clicks but I've used them in multiple apps and they work well.
You could look at my cascading combos example which has five of them

Thank you, I looked at that. Obviously, such a technique works well, but as I wrote earlier, it uses an unacceptable (for me) amount of screen real estate, and necessitates lots of extra clicking. I appreciate the link, and I know how to do that, but I don't want to. The reason I started this thread is that I want to figure out how to make my RC technique properly functional. I've thought of several ways to address the problem in the interim. All will be a good bit more work, but I believe they look promising.

First is to build a test DB that will explore limits of the RC system - build an RC menu and keep adding controls until it crashes. Running that with a number of variations in control type, number and nesting level should give me some indication of what the hard limits are. Then I can back away from that limit a bit and try continual rebuilds, again until it crashes. That should tell me if there is some upper limit on the number of add/re-add operations.

Finally, I can do a proper job of managing the menus: (1) simply change the caption of controls whose underlying data has changed; (2) insert only the new control into the proper place when a new value is added to the database, and remove only the proper control when the last instance of a value is removed from the database. There is no need to rebuild the entire menu every time. I did it that way initially, because it was simpler, and I didn't know that much about what I was doing when I first wrote this app. I've learned a lot since then. It will mean a good bit more code managing the menus, and tests for detecting when the last item disappears from a level, and therefore the parent item for that level should also be removed, but it will be a much cleaner and faster menu update, and will probably mean an end to the crashing, because I will be only doing at most a few menu item inserts and deletes, rather than the hundreds or even thousand I try to do currently.

Finally, I munched up the text data in a copy of the database, and wanted to post it here, but even zipped, it's over 6MB. The size limit for attachments is 2MB. I had to zip it, split it (using https://pinetools.com/split-files), and rezip the split pieces before I could attach it. You will need to unzip the pieces, join them with the file join tool on that same site, and unzip the result. The only fields that currently have an RC menu are the two bordered in purple. They should let you play with it enough to see how it works. I welcome any suggestions you may have, as long as the suggestion is not to give up on the concept. And if you see anything in there that you think might be useful to you in your own work, help yourself. If my efforts can be of benefit to someone else, I am only pleased.
Attached Files
File Type: zip Lichen.zip.000.zip (1.55 MB, 8 views)
File Type: zip Lichen.zip.001.zip (1.51 MB, 7 views)
File Type: zip Lichen.zip.002.zip (1.53 MB, 7 views)
File Type: zip Lichen.zip.003.zip (1.48 MB, 8 views)
__________________
This e-mail address is fake, to keep spammers and their address harvesters out of my hair. If you want to get in touch personally, I am 'pdanes' and I use yahoo mail. But please use the forums whenever possible, so that all may benefit from the exchange of ideas.
Petr Danes is offline   Reply With Quote
Old 04-06-2019, 04:26 AM   #18
essaytee
Need a good one-liner.
 
essaytee's Avatar
 
Join Date: Oct 2008
Location: Melbourne, Australia
Posts: 512
Thanks: 9
Thanked 123 Times in 119 Posts
essaytee is on a distinguished road
Re: Repeated rebuild of right-click menu throws error

Quote:
Originally Posted by Petr Danes View Post
I have an Access application that was originally built in Access 2000. Several textboxes and comboboxes use custom right-click menus to call filter routines. The RC menus are built in code, and some are quite extensive - hundreds of items, nested up to four levels deep.When data in a field changes, I need to rebuild the menu for that field, because the menus filter on the database's actual contents.

In 2000, it all worked well, but in newer versions, repeated rebuilds throw an error.

The relevant part of the code is here:

Code:
Dim rst0 As DAO.Recordset, rst1 As DAO.Recordset, rst2 As DAO.Recordset, rst3 As DAO.Recordset, qdf0 As DAO.QueryDef, qdf1 As DAO.QueryDef, qdf2 As DAO.QueryDef, AEp As CommandBarPopup, AEp1 As CommandBarPopup, AEp2 As CommandBarPopup, aec As CommandBarButton
    With Application.CommandBars("RCDatum")
        Do Until .Controls.count = 0
            If .Controls.count Then .Controls(1).Delete
        Loop
        Set rst0 = CurrentDb.QueryDefs("RCDatumDekady").OpenRecordset(acReadOnly)
        Set qdf0 = CurrentDb.QueryDefs("RCDatumRok")
        Set qdf1 = CurrentDb.QueryDefs("RCDatumRokMesic")
        Set qdf2 = CurrentDb.QueryDefs("RCDatumRokMesicDen")
        Do
            qdf0.Parameters("LoRok") = rst0.Fields("Dekada")
            qdf0.Parameters("HiRok") = rst0.Fields("Dekada") + 9
            Set rst1 = qdf0.OpenRecordset(acReadOnly)
            Set AEp = .Controls.Add(msoControlPopup)
The last line is where it bombs with the error "Unable to add control", but not always. It runs several times, but after about four or five rebuilds, it suddenly starts throwing an error on that line. Shutting it down, doing a C & R and retrying makes it work again, and again several times okay, then starts bombing.

I sort of suspect I'm abusing the RC system, that it was intended for a few items, more or less permanantly left in place, not such intensive build/rebuild activity with so many items, but I've not found any documentation on the subject, or anyone who claims to have experience with it.

Anybody have any ideas?
Just throwing this out there, where you loop through every control within the 'RCDatum' commandbar and delete, why not delete the 'RCDatum' commandbar directly; no need for the 'Do Until' code. Code I use, though not nearly as many items as what you require, is as follows:
Code:
    Dim strBarName As String
    strBarName = "rcm_frm_Car_Bookings"
     
    On Error Resume Next
    CommandBars(strBarName).Delete
    On Error GoTo 0
 
    Set cmbRC = CommandBars.Add(strBarName, msoBarPopup, False)
    ' then go about adding your controls
I don't know if the above method resolves your issue but, maybe it's worth a try. It's one delete as opposed to hundreds or more. Maybe the system wouldn't count the deletes of the individual controls, I don't know, just speculating.

__________________
Steve.

I know UNIX, PASCAL, C, FORTRAN, COBOL, and nineteen other high-tech words.
essaytee is offline   Reply With Quote
Old 04-06-2019, 04:38 AM   #19
Petr Danes
Newly Registered User
 
Join Date: Aug 2010
Posts: 48
Thanks: 0
Thanked 1 Time in 1 Post
Petr Danes is on a distinguished road
Re: Repeated rebuild of right-click menu throws error

Quote:
Originally Posted by essaytee View Post
Just throwing this out there, where you loop through every control within the 'RCDatum' commandbar and delete, why not delete the 'RCDatum' commandbar directly; no need for the 'Do Until' code. Code I use, though not nearly as many items as what you require, is as follows:
Code:
    Dim strBarName As String
    strBarName = "rcm_frm_Car_Bookings"
     
    On Error Resume Next
    CommandBars(strBarName).Delete
    On Error GoTo 0
 
    Set cmbRC = CommandBars.Add(strBarName, msoBarPopup, False)
    ' then go about adding your controls
I don't know if the above method resolves your issue but, maybe it's worth a try. It's one delete as opposed to hundreds or more. Maybe the system wouldn't count the deletes of the individual controls, I don't know, just speculating.
Thanks, it's worth a try. I'll add it to the experiments in my test database, although the deletes are quick, and the adds are where it crashes. But it's something to test, and see if deleting the entire root command bar changes the situation in any way.
__________________
This e-mail address is fake, to keep spammers and their address harvesters out of my hair. If you want to get in touch personally, I am 'pdanes' and I use yahoo mail. But please use the forums whenever possible, so that all may benefit from the exchange of ideas.
Petr Danes is offline   Reply With Quote
Old 04-06-2019, 06:32 AM   #20
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 10,931
Thanks: 114
Thanked 2,990 Times in 2,719 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Repeated rebuild of right-click menu throws error

I'll try and look at it later and let you know if I have any other suggestions beyond your test plan which is roughly how I would proceed in your situation
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin (Mendip Data Systems)
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 04-06-2019, 08:45 AM   #21
Petr Danes
Newly Registered User
 
Join Date: Aug 2010
Posts: 48
Thanks: 0
Thanked 1 Time in 1 Post
Petr Danes is on a distinguished road
Re: Repeated rebuild of right-click menu throws error

Just a brief note - I made an empty database with a single form and a textbox, to which I added RC controls in code. It just crashed, with 15,626 controls added. The textbox works. Takes several seconds, but that RC menu pops up and I can scroll through the controls.
__________________
This e-mail address is fake, to keep spammers and their address harvesters out of my hair. If you want to get in touch personally, I am 'pdanes' and I use yahoo mail. But please use the forums whenever possible, so that all may benefit from the exchange of ideas.
Petr Danes is offline   Reply With Quote
Old 04-06-2019, 10:09 AM   #22
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 10,931
Thanks: 114
Thanked 2,990 Times in 2,719 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Repeated rebuild of right-click menu throws error

Quote:
Originally Posted by Petr Danes View Post
Just a brief note - I made an empty database with a single form and a textbox, to which I added RC controls in code. It just crashed, with 15,626 controls added. The textbox works. Takes several seconds, but that RC menu pops up and I can scroll through the controls.
Sorry but can you clarify what that means and possibly post it here.
Forms have a limit in the number of controls over the form lifetime.
IIRC that limit is 768 or thereabouts. So clearly you don't mean form controls. What do you mean?

__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin (Mendip Data Systems)
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 04-06-2019, 12:47 PM   #23
Petr Danes
Newly Registered User
 
Join Date: Aug 2010
Posts: 48
Thanks: 0
Thanked 1 Time in 1 Post
Petr Danes is on a distinguished road
Re: Repeated rebuild of right-click menu throws error

Quote:
Originally Posted by isladogs View Post
Sorry but can you clarify what that means and possibly post it here.
Forms have a limit in the number of controls over the form lifetime.
IIRC that limit is 768 or thereabouts. So clearly you don't mean form controls. What do you mean?
That is the terminology used by Microsoft. Adding an item to an RC menu is called adding a control. In my original post, I quoted this line as the one that crashed:

Set AEp = .Controls.Add(msoControlPopup)

I executed that 15,626 times in my new test database before it crashed, and all those 15,626 items are in fact available via a right-click on the textbox to which I added all these 'controls'. Clearly, those are not the same controls as the normal controls that are placed on a form, like textboxes, comboboxes, labels and the like.
__________________
This e-mail address is fake, to keep spammers and their address harvesters out of my hair. If you want to get in touch personally, I am 'pdanes' and I use yahoo mail. But please use the forums whenever possible, so that all may benefit from the exchange of ideas.
Petr Danes is offline   Reply With Quote
Old 04-06-2019, 01:02 PM   #24
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 10,931
Thanks: 114
Thanked 2,990 Times in 2,719 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Repeated rebuild of right-click menu throws error

Just tried to look at your files from post #17.
I joined them to create the 6MB original using PineTools site but get an error that its not a valid archive



So I'm stuck unless you can shrink it further. Or possibly split the full zip file using Winzip if you have that
Did you remove all irrelevant items and most of the data from the file?
Did you compact before zipping?

As I said in my last reply, are you able to upload your test database?
Attached Images
File Type: png Capture.PNG (15.3 KB, 171 views)
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin (Mendip Data Systems)
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 04-06-2019, 01:25 PM   #25
Petr Danes
Newly Registered User
 
Join Date: Aug 2010
Posts: 48
Thanks: 0
Thanked 1 Time in 1 Post
Petr Danes is on a distinguished road
Re: Repeated rebuild of right-click menu throws error

Quote:
Originally Posted by isladogs View Post
Just tried to look at your files from post #17.
I joined them to create the 6MB original using PineTools site but get an error that its not a valid archive



So I'm stuck unless you can shrink it further. Or possibly split the full zip file using Winzip if you have that
Did you remove all irrelevant items and most of the data from the file?
Did you compact before zipping?

As I said in my last reply, are you able to upload your test database?
Check the instructions I wrote again - you have to UNZIP the individual pieces FIRST, then join the unzipped pieces, using that website, into a zipped total file, then unzip that to get the final .accdb file. Just tried it and it works fine, but you cannot join the the four zipped attachments directly.

And here is the test DB. It's a very simple construct - one form, with one textbox, and a simple routine that links an RC menu to that textbox and then adds controls until it crashes. On my machine it ran to 15,626, although it took a while.

Open the form in design view or run view - it doesn't matter. You can step through the code and try it every so often, and you will see the RC menu items being added, or you can just let it run for a bit. I've put a DoEvents into the loop, so you can stop it any time you want and see how it's doing.
Attached Files
File Type: accdb RCTester.accdb (928.0 KB, 7 views)
__________________
This e-mail address is fake, to keep spammers and their address harvesters out of my hair. If you want to get in touch personally, I am 'pdanes' and I use yahoo mail. But please use the forums whenever possible, so that all may benefit from the exchange of ideas.
Petr Danes is offline   Reply With Quote
Old 04-06-2019, 02:55 PM   #26
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 10,931
Thanks: 114
Thanked 2,990 Times in 2,719 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Repeated rebuild of right-click menu throws error

Sorry about that.
I've successfully unzipped the lichen file but keep getting error messages.
Due to the language issue, I don't know what its saying.
I haven't looked at the code yet ...but have seen your 4 level right click menu.
It does seem very clever and understand why you want to fix it rather than try something else
Again due to language issue why do you have a date value on the form where you right click to get the entire set of values in a 'treeview' structure?
And would a treeview be another possibility?

In the meantime, I'm just running your test build now - have slightly modified the code to debug.print every 50 loops in order to speed things up slightly. Currently at 8250 but is now extremely slow. Is it using up available connections? I have an app to check that but will first let it run till it crashes

What is the exact error you get when it crashes? (I suppose I'll find out myself eventually but I want to post this shortly before I sign off for tonight)

In advance of knowing the error, I'm just wondering whether any registry changes would help
e.g. increase maxlocksperfile / maxbuffersize
See e.g. https://www.access-programmers.co.uk...d.php?t=298749

UPDATE:
Just returned and it crashed but earlier than yours:



Same error as yours?
Attached Images
File Type: png Capture.PNG (4.8 KB, 139 views)
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin (Mendip Data Systems)
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by isladogs; 04-06-2019 at 03:24 PM.
isladogs is offline   Reply With Quote
Old 04-06-2019, 11:32 PM   #27
Petr Danes
Newly Registered User
 
Join Date: Aug 2010
Posts: 48
Thanks: 0
Thanked 1 Time in 1 Post
Petr Danes is on a distinguished road
Re: Repeated rebuild of right-click menu throws error

Quote:
Originally Posted by isladogs View Post
Sorry about that.
I've successfully unzipped the lichen file but keep getting error messages.
Due to the language issue, I don't know what its saying.
I haven't looked at the code yet ...but have seen your 4 level right click menu.
It does seem very clever and understand why you want to fix it rather than try something else

In the meantime, I'm just running your test build now - have slightly modified the code to debug.print every 50 loops in order to speed things up slightly. Currently at 8250 but is now extremely slow. Is it using up available connections? I have an app to check that but will first let it run till it crashes

What is the exact error you get when it crashes? (I suppose I'll find out myself eventually but I want to post this shortly before I sign off for tonight)

In advance of knowing the error, I'm just wondering whether any registry changes would help
e.g. increase maxlocksperfile / maxbuffersize
See e.g. https://www.access-programmers.co.uk...d.php?t=298749

UPDATE:
Just returned and it crashed but earlier than yours:



Same error as yours?
Yes, that is the same error - add method failed. I'm not all that surprised that the number is different. It's probably not a well-defined limit, like the number of controls per form, so it's probably just running out of resources somewhere. I'm running Access Professionl Plus 2010 on a 64-bit Win 7 ThinkPad - YMMV.

If you post a screenshot of the Czech error message, I'll tell you what it says. Not sure why you'd be getting a Czech error message - it must have detected something internal, otherwise error messages should be in the language of the computer it's running on.

The process does slow down as the number of controls increases. I don't know why. I don't think it should have anything to do with connection pooling - it's not writing to a normal data table, but I don't know for certain. I also ran into something weird last night - the menu is not saved when the form is saved. In my real database, all such changes do get saved, but not in the test one, even when I make a point of explicitly saving the form. I can close the form, reset the DB in the VBA window and everything continues to work, but when I close the DB and re-open it, the RC menu is gone. And it's not just disconnected, it doesn't exist. When I execute this line:

Set cbRoot = Application.CommandBars.Add("RCTestMenu", msoBarPopup, False, True)

the menu appears instantly, attached to the textbox, but it's empty, until I continue with the code, adding controls again.

Quote:
Again due to language issue why do you have a date value on the form where you right click to get the entire set of values in a 'treeview' structure?
And would a treeview be another possibility?
Sorry, I don't understand the question. You see how it works - the multi-level structure is to keep the available choices on the screen, instead of having to scroll through a long list of choices. Scrolling and clicking are both something I'm trying to avoid - the mouse-over is enough to expand and contract the choices. Both are annoying and take time, and fussy for precision in the case of scrolling a long RC menu.

Why I have a date value on the form - the user needed it. It's spread over three textboxes, because there are incomplete dates in the data - year and month, or only year. If it contained only real dates, I would have used a single textbox. The reason I have the values in the RC menu is so that the user can quickly select a date that actually exists in the data and filter the dataset for that date. I don't want to put a date selector control there, because there are many real dates that do not exist in the data. Picking through many non-existent dates to get the few that do exist is not how I want this to operate. The RC menu not only filters, but by its very existence shows whether a specific date even exists in the data, with having to go looking - filter the data and see that the result set is empty. That's slower and unnecessary effort for the user, when simply mousing over the RC menu shows you that information.

A treeview could also be made to work, but again, it would be another control on the form, which is what the RC menu avoids. A separate control not only takes up space, but looks similar to a place where data is entered. The RC menu is completely invisible until it's needed.
__________________
This e-mail address is fake, to keep spammers and their address harvesters out of my hair. If you want to get in touch personally, I am 'pdanes' and I use yahoo mail. But please use the forums whenever possible, so that all may benefit from the exchange of ideas.

Last edited by Petr Danes; 05-17-2019 at 10:28 AM.
Petr Danes is offline   Reply With Quote
Old 04-07-2019, 12:23 AM   #28
Petr Danes
Newly Registered User
 
Join Date: Aug 2010
Posts: 48
Thanks: 0
Thanked 1 Time in 1 Post
Petr Danes is on a distinguished road
Re: Repeated rebuild of right-click menu throws error

Just ran it again, with 10 textboxes using the same RC menu. This time it made it to 15,916 controls added before crashing, so it seems that it's not some hard-coded limit in Access - just running off the deep end, past what the designers ever thought might happen,or maybe didn't even think about it at all. It's slow to appear with that many items, and is always slow, even after repeated activations. Apparently it's not getting cached in any manner.

My next step will be to make 10 different menus - this last run used the same menu for all ten textboxes.

After that, I will start experimenting with various stages of cascading menus.
__________________
This e-mail address is fake, to keep spammers and their address harvesters out of my hair. If you want to get in touch personally, I am 'pdanes' and I use yahoo mail. But please use the forums whenever possible, so that all may benefit from the exchange of ideas.
Petr Danes is offline   Reply With Quote
Old 04-07-2019, 12:35 AM   #29
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 10,931
Thanks: 114
Thanked 2,990 Times in 2,719 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Repeated rebuild of right-click menu throws error

Just out of interest roughly how long does that take to reach the limit? On my PC it took over an hour to reach 10000 or so.

As previously mentioned, I would try a few other things first as its clearly running out of 'resources'
1. Check available connections. See http://www.mendipdatasystems.co.uk/a...ons/4594418530
2. Modify registry settings to increase maxlocksperfile and maxbuffersize values.
All of those are easy to do and may help or at least eliminate an area to investigate.

I will attach the Czech message later today. Its an automation error IIRC
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin (Mendip Data Systems)
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 04-07-2019, 12:56 AM   #30
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 10,931
Thanks: 114
Thanked 2,990 Times in 2,719 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Repeated rebuild of right-click menu throws error

The attached automation error message appears when I open the application.
It also appears after using either of the two right click menus which prevents the Datum or Prir Celky item being updated

In addition, if I instead use the dropdown to select the Prir Celky item, there is a brief appearance of a blue box with text and a blank green rectangle. It then disappears almost immediately. If that's not intentional, I'll pause the code later and get a screenshot.
You have 6 code events on that combo. Could that be rationalised into fewer events to prevent possible conflicts

For info I also get a Czech message when I click on the Fotogalerie button but I think that's intentional
Attached Images
File Type: png Capture1.PNG (7.5 KB, 12 views)

__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin (Mendip Data Systems)
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Reply

Tags
menu , right-click , vba

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chr(0) throws and error DanielR General 8 04-18-2018 09:11 AM
[SOLVED] Right click menu - shortcut menu - edit existing item - possible? essaytee Modules & VBA 1 08-27-2017 01:53 AM
Right click menu - type mismatch error Access 2010 essaytee Modules & VBA 2 07-18-2017 04:30 PM
SQL Join throws error 3258 hydeyho SQL Server 1 03-27-2007 05:52 AM
query re-writes itself and throws error dhx10000 Queries 1 03-13-2006 02:20 PM




All times are GMT -8. The time now is 01:29 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World