-
WSchico
AskWoody LoungerI noticed the problem (bug) in Access97 SR2. It works great for returning an email address. If you want the carriage returns, you could try this:
If Eval(“MsgBox(‘You have just deleted the current record.” & chr(13) & “Click “”OK”” to confirm your delete or “”Cancel”” to undo your deletion.” & chr(13) & chr(13)‘,1, ‘Test Message Box’)”) = vbOK Then
‘Do somthing here
End IfThat format worked for me when getting an email address from a text box and displaying it in the message part of the message box with other text and line breaks.
-
WSchico
AskWoody LoungerOk, problem solved. I reread the posts and tried the recalc idea (once I figured out what it did). So I stuck “Me.Recalc” in the subform’s AfterInsert right before the check and bingo…works like a charm. Thanks again for all your suggestions.
-
WSchico
AskWoody LoungerNope, no change.
-
WSchico
AskWoody LoungerThanks for all your help, Mark. I tried DoEvents to no avail. I also forced the total box on the subform to requery, followed by the total box on the main form, then ran the check. Still no dice. I can see the focus go briefly to the total box to perform the check then continue with the code as if the check was false. It’s just that the calculation isn’t working fast enough (and it’s not that complicated). The next record entered picks up on the check being true, but what happens if the user has only one entry? I would like for it to be instantanious (or at least seemingly)
-
WSchico
AskWoody LoungerI tried it in the AfterInsert with the same results. The check is performed correctly, from what I can see, but the problem is that the check is made before the total is calculated. Would it be possible/wise to put in a 1 or 2 second delay between entering the record and performing the check in order to allow the calulated field to, um well, calculate?
-
WSchico
AskWoody LoungerI tried the format method and got an error. Evidently, Access 97 SR2 only wants you to use format with dates.
-
WSchico
AskWoody LoungerOk, problem solved. I ended up just putting another field in the query to test if the part number was #5.
test5: iif([part_num] “#5”,1,2)
then I just grouped on the test5 field on the report and hid the field. I made a total field in the group footer, but since I only wanted to see the total for #5 once, I hid the footer if the detail was for #5 i.e.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If test5 = 2 Then
Reports!myreport.Section(6).Visible = False
Else
Reports!myreport.Section(6).Visible = True
End If
End SubFrom there I just put a “Grand Total” field in the report footer and voila!
Thanks for the ideas. They were just the spark I needed to get back on track. I had forgotten that the user doesn’t need to see everything that’s going on…just the final product. -
WSchico
AskWoody LoungerThis is an inventory report. . Part #5 is like a generic part number for “in transit” or “in production” parts (I didn’t design nor do I have any control over the numbering scheme). The reason for leaving it out initially is to get a total “on-hand”. Then #5’s total is added to the on-hand total to get a grand total. I’ll play around with the grouping option, but I’m not sure exactly how it works. In the mean time, I created a separate query that only totals part #5. I then created a new form that has a text box that displays that total. From there, I changed the report’s control source to exclude #5 and added a text box to the footer that displays the #5 total from the form and then adds it to the total for all the others. Kind of a crude work around but it works. Now I can concentrate more on your suggestions to help automate the process.
Thanks for the link to the report sample db. I had it once before and lost it. Were it not for the “Solutions”, “QrySample”, and “ReportSample” db’s I wouldn’t be anywhere close to where I am now in my knowledge of Access.
-
WSchico
AskWoody LoungerMay 16, 2002 at 2:58 pm in reply to: Macro to insert formula for dynamic column numbers (97-SR2) #588409I tried your last example and it was almost there. It placed the formula in the first cell I actually wanted to calculate. But I played around with it and came up with a solution. For anyone else who may be wandering, the code I have now is:
Dim lastcell As Integer, bcell As Integer, ecell As Integer
lastcell = ActiveSheet.UsedRange.Columns.Count
bcell = (lastcell – 8 – ActiveCell.Column)
ecell = lastcell – 6 – ActiveCell.ColumnActiveCell.FormulaR1C1 = “=sum(rc[” & bcell & “]:rc[” & ecell & “])”
This sets the formula for the current cell (which was selected previously in the code) = the sum of the cells 8 to 6 cells from the last column. So if you have a sheet with 12 columns (A thru L), if B1 is active, this code will generate the formula for cell B1 as
=SUM(D1:F1)
This way, I think, no matter how many more months are added, only the last 3 are summed, since there will always be 6 columns from the last month to the end of the “row”.
Thanks again for your help.
-
WSchico
AskWoody LoungerMay 15, 2002 at 7:28 pm in reply to: Macro to insert formula for dynamic column numbers (97-SR2) #588246Hi John. Thanks for a quick response. I tried your example, but I don’t think I did it right. Here’s what I have now:
Dim lastcell, bcell, ecell As Long
lastcell = ActiveSheet.UsedRange.Columns.Count
bcell = lastcell – 8
ecell = lastcell – 6
Range(Range(“F2”), Range(“F2”).End(xlDown)).Offset(-8, 0).FormulaR1C1 = “=SUM(RC[15]:RC[17])”Still Get the Same error. I’m not familiar with the Offset property so I don’t really know what it’s doing. I will lookk at the Help file on it in the morning and see if I can make heads or tails of it. In the mean time, are there any clarifications I can make to the question to make it more sensible?
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
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
-
Firefox 139
by
Charlie
1 hour, 29 minutes ago -
Who knows what?
by
Will Fastie
31 minutes ago -
My top ten underappreciated features in Office
by
Peter Deegan
9 minutes ago -
WAU Manager — It’s your computer, you are in charge!
by
Deanna McElveen
8 hours, 25 minutes ago -
Misbehaving devices
by
Susan Bradley
1 hour, 9 minutes ago -
.NET 8.0 Desktop Runtime (v8.0.16) – Windows x86 Installer
by
WSmeyerbos
1 day, 2 hours ago -
Neowin poll : What do you plan to do on Windows 10 EOS
by
Alex5723
2 hours, 24 minutes ago -
May 31, 2025—KB5062170 (OS Builds 22621.5415 and 22631.5415 Out-of-band
by
Alex5723
1 day ago -
Discover the Best AI Tools for Everything
by
Alex5723
1 day ago -
Edge Seems To Be Gaining Weight
by
bbearren
14 hours, 55 minutes ago -
Rufus is available from the MSFT Store
by
PL1
22 hours, 58 minutes ago -
Microsoft : Ending USB-C® Port Confusion
by
Alex5723
2 days, 1 hour ago -
KB5061768 update for Intel vPro processor
by
drmark
1 hour, 38 minutes ago -
Outlook 365 classic has exhausted all shared resources
by
drmark
20 minutes ago -
My Simple Word 2010 Macro Is Not Working
by
mbennett555
1 day, 21 hours ago -
Office gets current release
by
Susan Bradley
2 days ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
3 days, 14 hours ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
2 days, 22 hours ago -
Stop the OneDrive defaults
by
CWBillow
3 days, 15 hours ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
4 days, 1 hour ago -
X Suspends Encrypted DMs
by
Alex5723
4 days, 3 hours ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
4 days, 3 hours ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
4 days, 4 hours ago -
OpenAI model sabotages shutdown code
by
Cybertooth
4 days, 4 hours ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
3 days, 16 hours ago -
Enabling Secureboot
by
ITguy
3 days, 23 hours ago -
Windows hosting exposes additional bugs
by
Susan Bradley
4 days, 12 hours ago -
No more rounded corners??
by
CWBillow
4 days, 8 hours ago -
Android 15 and IPV6
by
Win7and10
3 days, 22 hours ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
5 days, 1 hour ago
Recent blog posts
Key Links
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
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.