-
WSRNCIENG
AskWoody LoungerYou guys are AWESOME!!!! Thanks for your time and effort. Have a great day.
-
WSRNCIENG
AskWoody LoungerWOW!!!! Now that’s what I’m talking about….it does exactly what I was looking for….RG, you rock.
Sorry about not uploading the sample spreadsheet, however, with your solution, it turns out I didn’t need it; with that said, I’m still curious if what you applied could work with your original post and my adaption? The sample spreadsheet is attached this time.
However, I understand if you don’t have time and others need your help.
Again, thanks a bunch for everyone’s time and effort, it’s greatly appreciated.
-
WSRNCIENG
AskWoody LoungerRG
I was wondering if we could take your code a step further and am attaching a sample spreadsheet for clarification purposes.
Again, thanks in advance.
-
WSRNCIENG
AskWoody LoungerThank all of you very much. Each suggestion works, however, the one that ultimately will provide what I want (since I eventually want to use it on any given cell) is RG’s. You guys rock.
-
WSRNCIENG
AskWoody LoungerPaul,
Yes, I want the name of the spreadsheet that is currently open. I only want a portion of the name, the first left 4 characters. Since my post however, I put a function together to capture the current open spreadsheet and is below:
Function GetMyName() As StringDim sAgency As String
GetMyName = ActiveWorkbook.Name
sAgency = Left(GetMyName, 4)End Function
This will give return the value I’m looking for but what I want to do next is place that value in a cell in the spreadsheet if another cell IS NOTNULL. I understand that a Function can’t return values to cells so I need an IF THEN ELSE statement and trigger it with an OnEvent action; something like this:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If IsNull(Me.ActiveSheet!L3) Then
Me.ActiveSheet!b3 = “”
Else
Me.ActiveSheet!b3 = sAgency
End IfEnd Sub
So this is my newest delima, it doesn’t work! If you could offer a suggestion, I would be most grateful.
-
WSRNCIENG
AskWoody LoungerWhat I need, is it acheivable if I change the form to “Single” and apply a list box and apply code to the AfterUpdate Event of the list box? Along the lines of:
[codebox]if IsNull(lstOutcome.column(4)) then
msgbox “1”
else
msgbox “2”
end if[/codebox] -
WSRNCIENG
AskWoody LoungerThanks Wendell, much appreciated.
Changing to single isn’t an option. What if I removed the option group and put a field with in the dataset, say “int_OutcomeAssigned”, make it a bound control on the form. Put code in the OnLoad event along these lines.
[codebox]If int_OutcomeAssigned=0 then
int_OutcomeAssigned.visible=False
Else
int_OutcomeAssigned.visible=True
end if
[/codebox] -
WSRNCIENG
AskWoody LoungerWhat type of form are you using? A single form or a continuous form?
Continuous
-
WSRNCIENG
AskWoody LoungerCreate a query based on the table.
Add a calculated column to the query grid:d: [dDateOfAttempt]-Weekday([dDateOfAttempt],2)
Also add the Count field.
Select View | Totals.
Change the Total option for the Count field to Sum.
Switch to datasheet view.The SQL for this query is
SELECT [dDateOfAttempt]-Weekday([dDateOfAttempt],2) AS d, Sum(NameOfTable.Count) AS SumOfCount
FROM NameOfTable
GROUP BY [dDateOfAttempt]-Weekday([dDateOfAttempt],2);where NameOfTable is the name of the table.
Sorry for slow response, thanks Hans, works perfectly
-
WSRNCIENG
AskWoody LoungerBy the way, do you want to do this in Access or in Excel? You have posted in the Access forum, but the attachment is an Excel workbook.
I want to do this in Access (in a query preferrably. Even if the function is in a module, I can call the function within a query). I only put the example in Excel.
Thanks.
-
WSRNCIENG
AskWoody LoungerWhy do most weeks end on Friday, but one of them on Thursday (July 9)?
In the attached example that was an error on my part. The week actually ended on 7/10/2009. I’ve made the change and have attached a new example. With that said, if a holiday is in the middle of the week, it has to be accounted for as well. i.e. if 7/4/2009 was on a Friday, the company would be off work, therefore there would be 3 days between activity.
-
WSRNCIENG
AskWoody LoungerThe On Load event of the subform does not occur when it is made visible, but when the main form is loaded, whether the subform is visible or not. So the code you wrote is not executed when the subform is made visible.
You’ll have to show/hide controls on the subform from your main form code.Thanks Hans,
That did the trick. Much appreciated.
-
WSRNCIENG
AskWoody LoungerThanks Hans,
That works….I don’t know why I insist on overlooking the obvious and making my work harder than it needs to be.
Much appreciated.
-
WSRNCIENG
AskWoody LoungerThanks Hans,
Sorry for the delayed response, however your suggestion worked perfectly.
-
WSRNCIENG
AskWoody LoungerAs always Hans, thank you and YOU ARE THE BEST.
![]() |
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
-
New Microsoft Nag — Danger! Danger! sign-in to your Microsoft Account
by
EricB
1 hour, 45 minutes ago -
Blank Inetpub folder
by
Susan Bradley
2 hours, 36 minutes ago -
Google : Extended Repair Program for Pixel 7a
by
Alex5723
4 hours, 28 minutes ago -
Updates seem to have broken Microsoft Edge
by
rebop2020
8 hours, 12 minutes ago -
Wait command?
by
CWBillow
2 hours, 3 minutes ago -
Malwarebytes 5 Free version manual platform updates
by
Bob99
11 hours, 7 minutes ago -
inetpub : Microsoft’s patch for CVE-2025–21204 introduces vulnerability
by
Alex5723
17 hours, 42 minutes ago -
Windows 10 finally gets fix
by
Susan Bradley
1 day, 2 hours ago -
AMD Ryzen™ Chipset Driver Release Notes 7.04.09.545
by
Alex5723
1 day, 3 hours ago -
Win 7 MS Essentials suddenly not showing number of items scanned.
by
Oldtimer
22 hours, 29 minutes ago -
France : A law requiring messaging apps to implement a backdoor ..
by
Alex5723
1 day, 17 hours ago -
Dev runs Windows 11 ARM on an iPad Air M2
by
Alex5723
1 day, 17 hours ago -
MS-DEFCON 3: Cleanup time
by
Susan Bradley
12 hours, 49 minutes ago -
KB5056686 (.NET v8.0.15) Delivered Twice in April 2025
by
lmacri
9 hours, 29 minutes ago -
How to enable Extended Security Maintenance on Ubuntu 20.04 LTS before it dies
by
Alex5723
2 days, 5 hours ago -
Windows 11 Insider Preview build 26200.5562 released to DEV
by
joep517
2 days, 9 hours ago -
Windows 11 Insider Preview build 26120.3872 (24H2) released to BETA
by
joep517
2 days, 9 hours ago -
Unable to eject external hard drives
by
Robertos42
19 hours, 33 minutes ago -
Saying goodbye to not-so-great technology
by
Susan Bradley
7 hours, 14 minutes ago -
Tech I don’t miss, and some I do
by
Will Fastie
5 hours, 8 minutes ago -
Synology limits hard drives
by
Susan Bradley
3 days, 13 hours ago -
Links from Microsoft 365 and from WhatsApp not working
by
rog7
2 days, 15 hours ago -
WhatsApp Security Advisories CVE-2025-30401
by
Alex5723
3 days, 19 hours ago -
Upgrade Sequence
by
doneager
3 days, 12 hours ago -
Chrome extensions with 6 million installs have hidden tracking code
by
Nibbled To Death By Ducks
1 day, 18 hours ago -
Uninstall “New Outlook” before installing 2024 Home & Business?
by
Tex265
2 days, 11 hours ago -
The incredible shrinking desktop icons
by
Thumper
4 days, 16 hours ago -
Windows 11 Insider Preview Build 22635.5240 (23H2) released to BETA
by
joep517
4 days, 17 hours ago -
Connecting hard drive on USB 3.2 freezes File Explorer & Disk Management
by
WSJMGatehouse
1 day, 16 hours ago -
Shellbag Analyser & Cleaner Update
by
Microfix
1 day, 10 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.