-
WSSimonC
AskWoody LoungerHi RetiredGeek,
That’s an interesting way of handling menus which would probably have meant that the problem couldn’t have reared itself in the first place.
The application I was referring to already uses code to create some popup menus from scratch, so it wouldn’t be a big step to doing the lot. Hmm. I will ponder.
Thanks very much for the suggestions. I would still love to know the root cause of the problem I had, but switching to function calls from the menu was a good workaround.
-
WSSimonC
AskWoody LoungerThanks RetiredGeek, I’d considered that as a possibility but this is intended to solve a problem on one particular PC and I was hoping not to make any changes to the application.
The reason I’m trying to do this is that just one computer, of a number that run this database, seems to have developed a problem whereby it has an issue with the existing menu which, on that computer alone, keeps disappearing. I’ve tried recreating the menu by hand and from scratch and that seems to work, but so far I’ve only created a much simpler version of the menu with fewer options. So I was just experimenting with a way of recreating the full menu to see whether, if created anew on that machine, that would also stay put.
If I knew that it would, then it would be worth the effort re-creating it manually. But as I don’t it would be very helpful to have a way of easily re-running the creation while I experiment and see if perhaps the problem can be pinned down to any particular part of the menu.
EDIT: I guess I could get away with having a single generic function, along the lines of
Code:Public Function MenuOpenForm(ByVal FormName As String) DoCmd.OpenForm FormName, acNormal End Function
and making the OnAction property equal to
Code:=MenuOpenForm(“dlgFormName”)
By the way, I’ve noticed that the same problem affects any reports run straight from the menu, but the same kind of solution would work there too.
-
WSSimonC
AskWoody LoungerThanks, Hans.
That would work brilliantly well for a report. If I wanted to do the same thing in a form, there wouldn’t be any way of doing it while at the same time allowing the formatted text box to be inputable, I’d have to have a separate input box?
Regards,
Simon
-
WSSimonC
AskWoody LoungerEdited by HansV to display [red] instead of red text.
I’ve got a problem that’s similar enough that it didn’t seem worth starting a new thread.
I have a field which can contain positive or negative numbers. The positive numbers may have a decimal part but may be whole numbers. I would like to use the General Number convention to display the positive values i.e. for decimal values, a decimal point and one or more digits after it, but for integers I would just like to display the integer part with no decimal point. However for negative numbers, I would like to use a specific format (“0.00[red]”). (sorry, that format should have the word ‘red’ in square brackets as part of it, but I don’t know how to make that appear correctly, it just colours the subsequent text red instead)
If there any way I can combine the two using the Format property, or would I need to do something different.
Thanks,
Simon
-
WSSimonC
AskWoody LoungerThe problem relates to missing data – or an incorrect join. The queries underlying the crosstabs (QueryFermiM1com and QueryFermiM2com) link a table (either COM1 or COM2) to table FERMI1 using the field CODF.
In the case of table COM1 no records dated after April contain any value in the CODF field. In the case of table COM2, no records dated after March contain a value in this field. Because the two queries use inner joins, the only records being returned will be those with values in the CODF field which are also in the FERMI1 table, so no data will be generated for May at all, and only some (from COM1 only) for April.
-
WSSimonC
AskWoody LoungerThe problem is unrelated to the fact that you’re using a union query – any statement along the lines of SELECT A, B, C AS D FROM XYZ WHERE D = “” will result in the user being prompted for a value for “D”. The reason is that D doesn’t exist as a field in source tables to the query itself, it’s merely a label applied to a field or expression on execution. In the same way, you can’t use GROUP BY D either, you have to GROUP BY whatever it was you’d renamed as “D”.
As any WHERE, GROUP BY etc clause operates on the source data before the query begins its output, these labels don’t really exist at that point.
What you can do, of course, is something like SELECT “A” AS C, “B” AS D, C & D AS E FROM XYZ, because the expression is then working on the output values, not trying to apply it to the input values.
-
WSSimonC
AskWoody LoungerApril 30, 2004 at 6:34 am in reply to: Database read only for non Admins? (Office/Access 2000 SP1A) #821757I think it might be a file permissions problem.
When opening an Access database, if no other user currently has that database open, Access creates a .ldb file in the same folder as the mdb/mde file. If permission to create files in this folder resides with Administrators but not PowerUsers, it might explain why the latter can’t be the first to open the database.
Once this .ldb file has been created, the need to file creation rights disappears as all subsequent database users merely need rights to modify this file.
Of course, when the last person using the database closes it, the .ldb file will be deleted and thus the database becomes readonly again to all but the Administrators.
-
WSSimonC
AskWoody LoungerApril 30, 2004 at 6:34 am in reply to: Database read only for non Admins? (Office/Access 2000 SP1A) #821758I think it might be a file permissions problem.
When opening an Access database, if no other user currently has that database open, Access creates a .ldb file in the same folder as the mdb/mde file. If permission to create files in this folder resides with Administrators but not PowerUsers, it might explain why the latter can’t be the first to open the database.
Once this .ldb file has been created, the need to file creation rights disappears as all subsequent database users merely need rights to modify this file.
Of course, when the last person using the database closes it, the .ldb file will be deleted and thus the database becomes readonly again to all but the Administrators.
-
WSSimonC
AskWoody LoungerThere is indeed a further problem, though, if you’re intending to include this code (or the call to this code) in every report. If this is being used only in a “master” report then Charlotte’s code does the business.
As I suggested yesterday (but at that point hadn’t tried it), report A errors trying to close report A, so the added “If” statement will avoid that eventuality. But when report A closes report B, report B’s own OnClose event will kick in and the code that calls will hit the error condition not only when it tries to close itself, but also when it tries to close report A. If this error isn’t fatal then when B closes C, C’s OnClose event starts. Assuming there are no further reports, C will try to close A (fails), B (fails) and will skip trying to close itself. It then closes for real, and control returns to B’s OnClose. This has finished its loop (C being the last report) so it too terminates and the report B closes. Report A has only just started its loop, so it will still try to close B and C, but this will fail with a different error as the only report open will be A – so by this time, Reports(i) is invalid for any value of i > 0.
The easiest solution might be to add error handling to CloseAllReports and in it, check first whether the error is either 2585 (This action can’t be carried out while processing a form or report event.) or 2457 (The number you used to refer to the report is invalid). When it is, just resume processing, otherwise, report the error.
-
WSSimonC
AskWoody LoungerThere is indeed a further problem, though, if you’re intending to include this code (or the call to this code) in every report. If this is being used only in a “master” report then Charlotte’s code does the business.
As I suggested yesterday (but at that point hadn’t tried it), report A errors trying to close report A, so the added “If” statement will avoid that eventuality. But when report A closes report B, report B’s own OnClose event will kick in and the code that calls will hit the error condition not only when it tries to close itself, but also when it tries to close report A. If this error isn’t fatal then when B closes C, C’s OnClose event starts. Assuming there are no further reports, C will try to close A (fails), B (fails) and will skip trying to close itself. It then closes for real, and control returns to B’s OnClose. This has finished its loop (C being the last report) so it too terminates and the report B closes. Report A has only just started its loop, so it will still try to close B and C, but this will fail with a different error as the only report open will be A – so by this time, Reports(i) is invalid for any value of i > 0.
The easiest solution might be to add error handling to CloseAllReports and in it, check first whether the error is either 2585 (This action can’t be carried out while processing a form or report event.) or 2457 (The number you used to refer to the report is invalid). When it is, just resume processing, otherwise, report the error.
-
WSSimonC
AskWoody LoungerI think your problem might be that Access doesn’t like you trying again to close the current report when it’s already proccessing the OnClose event for it.
You could try something like If Reports(i).Name Me.Name Then DoCmd.Close acReport, Reports(i).Name
On a similar basis, you might want to watch out for problems if you include the code in each report’s OnClose event. When you close report A and it tries to close report B, report B’s OnClose event will fire and that will start trying to work its way through the open reports too.
-
WSSimonC
AskWoody LoungerI think your problem might be that Access doesn’t like you trying again to close the current report when it’s already proccessing the OnClose event for it.
You could try something like If Reports(i).Name Me.Name Then DoCmd.Close acReport, Reports(i).Name
On a similar basis, you might want to watch out for problems if you include the code in each report’s OnClose event. When you close report A and it tries to close report B, report B’s OnClose event will fire and that will start trying to work its way through the open reports too.
-
WSSimonC
AskWoody LoungerHans, I’ve stripped the whole DB down, and now, of course, that part of the program works perfectly!
I shall try again…
-
WSSimonC
AskWoody LoungerHans, I’ve stripped the whole DB down, and now, of course, that part of the program works perfectly!
I shall try again…
-
WSSimonC
AskWoody LoungerThanks Hans, I’ll have a go at stripping it down and posting it here. May take me an evening or two to get it done.
Simon.
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Proton to drop prices after ruling against “Apple tax”
by
Cybertooth
5 hours, 27 minutes ago -
24H2 Installer – don’t see Option for non destructive install
by
JP
5 hours, 53 minutes ago -
Asking Again here (New User and Fast change only backups)
by
thymej
16 hours, 48 minutes ago -
How much I spent on the Mac mini
by
Will Fastie
6 hours, 15 minutes ago -
How to get rid of Copilot in Microsoft 365
by
Lance Whitney
8 hours, 36 minutes ago -
Spring cleanup — 2025
by
Deanna McElveen
22 hours, 40 minutes ago -
Setting up Windows 11
by
Susan Bradley
1 hour, 3 minutes ago -
VLC Introduces Cutting-Edge AI Subtitling and Translation Capabilities
by
Alex5723
18 hours, 8 minutes ago -
Powershell version?
by
CWBillow
19 hours, 1 minute ago -
SendTom Toys
by
CWBillow
3 hours, 17 minutes ago -
Add shortcut to taskbar?
by
CWBillow
22 hours, 56 minutes ago -
Sycophancy in GPT-4o: What happened
by
Alex5723
1 day, 15 hours ago -
How can I install Skype on Windows 7?
by
Help
1 day, 14 hours ago -
Logitech MK850 Keyboard issues
by
Rush2112
20 hours, 56 minutes ago -
We live in a simulation
by
Alex5723
2 days, 5 hours ago -
Netplwiz not working
by
RetiredGeek
1 day, 16 hours ago -
Windows 11 24H2 is broadly available
by
Alex5723
2 days, 17 hours ago -
Microsoft is killing Authenticator
by
Alex5723
1 day, 5 hours ago -
Downloads folder location
by
CWBillow
3 days ago -
Remove a User from Login screen
by
CWBillow
1 day, 19 hours ago -
TikTok fined €530 million for sending European user data to China
by
Nibbled To Death By Ducks
2 days, 15 hours ago -
Microsoft Speech Recognition Service Error Code 1002
by
stanhutchings
2 days, 15 hours ago -
Is it a bug or is it expected?
by
Susan Bradley
17 hours, 35 minutes ago -
Image for Windows TBwinRE image not enough space on target location
by
bobolink
2 days, 14 hours ago -
Start menu jump lists for some apps might not work as expected on Windows 10
by
Susan Bradley
1 day, 14 hours ago -
Malicious Go Modules disk-wiping malware
by
Alex5723
3 days, 4 hours ago -
Multiple Partitions?
by
CWBillow
3 days, 4 hours ago -
World Passkey Day 2025
by
Alex5723
1 hour, 53 minutes ago -
Add serial device in Windows 11
by
Theodore Dawson
4 days, 13 hours ago -
Windows 11 users reportedly losing data due forced BitLocker encryption
by
Alex5723
2 days, 14 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.