-
WSAccessMan
AskWoody LoungerI think that will work! Thanks a bunch Hans!
-
WSAccessMan
AskWoody LoungerWell, I’ve almost got it working…. After moving the fields around as Hans suggested, i get the sums to total, but they are not quite right. Since the square footage is tied to the clusters, in which are made up of several rooms (without individual square footages), the query displays the cluster square footage for each room. This means the report is trying to sum all the instances of the square footages. If there is only one room in the cluster, then the sums work correctly. If there are three rooms in a cluster, and the cluster area is 400 s.f., then the sum is 1200 (3 x 400). It is summing the area for each room, not the overall area of each cluster. What can i do to fix this? I only have 2 hours to get this completed. Thanks so much for your help!
-
WSAccessMan
AskWoody LoungerIt’s been a while since i was heavy into Access.. assume i will make those changes and see if the report totals will work. Thanks for the tip!
-
WSAccessMan
AskWoody Loungerhere is the attachment… I guess i should have tried zipping it. After 12 hours of work, sometimes your brain just gets fried! I have included the two reports that I need done. There area labels indicating where and what sums need to be calculated. Thank you for everyone who is trying to help me out!
-
WSAccessMan
AskWoody LoungerI’m coming up with numbers like 10 million! not quite right… In my tables, i have one with department clusters that each have an area square footage. I combine these in a query so each room shows up in it’s appropriate cluster. In the query, the area of the cluster displays for each room. I think this is what the total area is adding. Am i doing something wrong? thanks for your help!
-
WSAccessMan
AskWoody LoungerHans, You are just the greatest!!
worked like a charm!
-
WSAccessMan
AskWoody LoungerThanks Hans
Worked like a charm!!
-
WSAccessMan
AskWoody LoungerWell, it looks like the problem lies in that i had the modal property of the main menu set to yes… I turned it off and things worked again.. Does anybody know why this would happen?
Thanks
-
WSAccessMan
AskWoody LoungerSo, is the program still comparing the original value to the values in the list? I did what you said, and even though the new value that displays in the combo box is also in the list, it still gives me the notinlist error. It would seem to me that if the new value was in the list, it should not give me the error, but if it is still comparing the old value, i don’t know what there is that i can do to stop it
Should i consider giving up at this point? My last day working here is next friday, and this project needs to be done before i leave. I was hoping this was a simple problem (simple for the experts like you, anyways), but it is turning out to be a big hassle…
So, i guess if you have any other suggestions, i would be happy to try them, otherwise i will put this issue in the graveyard of things that can’t be done
-
WSAccessMan
AskWoody LoungerCharlotte
adding Me.cmbCustomer.Undo before the value is changed appears to do nothing… is this what you meant, or am i doing something wrong here? I know you are very busy, and i appreciate the help you are giving me. I am on the verge of just telling the owners that we can’t check for abbreviations.. I would really not like to do that.
here is the code i am working with (including the undo you suggested).
Private Sub cmbCustomer_NotInList(NewData As String, Response As Integer)
Dim Db As DAO.Database
Dim Rs As DAO.Recordset
Dim Msg As String
Dim strNewData As StringOn Error GoTo Err_cmbCustomer_NotInList
‘ Exit this subroutine if the combo box was cleared.
If NewData = “” Then Exit SubstrNewData = NewData
strNewData = ChangeAbbreviations(strNewData)‘ Confirm that the user wants to add the new customer.
Msg = “The Customer ‘” & strNewData & “‘ does not exist.” & vbCr & vbCr
Msg = Msg & “Do you wish to add this Customer? @@Please make sure punctuation and spelling are correct!!”
If MsgBox(Msg, vbQuestion + vbYesNo) = vbNo Then
‘ If the user chose not to add a customer, set the Response
‘ argument to suppress an error message and undo changes.
Response = acDataErrContinue
‘ Display a customized message.
MsgBox “Please select a Customer from the list”
Else
‘ If the user chose to add a new customer, open a recordset
‘ using the Customers table.
Set Db = CurrentDb
Set Rs = Db.OpenRecordset(“tblCustomers”, dbOpenDynaset)‘ Create a new record.
Rs.AddNew
Rs![Customer Name] = strNewData
Rs![Customer Order] = “999”
Rs![Report Customer Name] = strNewData‘ Save the record.
Rs.Update‘ Set Response argument to indicate that new data is being added.
Response = acDataErrAdded
Me.cmbCustomer.Undo
Me.cmbCustomer = strNewData
Me.cmbCustomer.Text = strNewDataEnd If
Exit_cmbCustomer_NotInList:
Exit Sub
Err_cmbCustomer_NotInList:
‘ An unexpected error occurred, display the normal error message.
MsgBox Err.Description
‘ Set the Response argument to suppress an error message and undo
‘ changes.
Response = acDataErrContinue
End Sub -
WSAccessMan
AskWoody LoungerCharlotte,
I tried adding it directly after the value changed, and it kept asking me to add the new value (basically calling the notinlist function again). Everytime i said OK, it asked me again. When i said No, it went to my custom message to select a customer from the list.
Any thoughts about johnhutchinson’s post? I am wondering if LostFocus would cause any unforseeable problems in the future. I will give it a whirl and see what happens
Thanks for your help, as always
-
WSAccessMan
AskWoody LoungerCharlotte,
Thanks for your reply. You were right, this did get me closer. Now what happens is that everything gets added correctly and the combo box text changes to match the new value without triggering the notinlist event. However, when the program continues through until the end (exit sub), it says the item is not in the list (even though the item did actually get put in the list). Any idea what is happening?Thanks for your help and patience.
-
WSAccessMan
AskWoody LoungerHere is the notinlist event which i am using. The ChangeAbbreviations function returns an abbreviated version of the NewData string that is input. The part where i am changing the NewData to the new string is where i am having problems. Like i said, everything works (as far as adding the correct record, updating the combo box, etc), except where the text in the combo box (before the change) is not the same as the NewData. If you need more, i can post a dummy db with the sample form i created..
Thanks in advance
Private Sub cmbCustomer_NotInList(NewData As String, Response As Integer)
Dim Db As DAO.Database
Dim Rs As DAO.Recordset
Dim Msg As StringOn Error GoTo Err_cmbCustomer_NotInList
‘ Exit this subroutine if the combo box was cleared.
If NewData = “” Then Exit SubNewData = ChangeAbbreviations(NewData)
‘ Confirm that the user wants to add the new customer.
Msg = “The Customer ‘” & NewData & “‘ does not exist.” & vbCr & vbCr
Msg = Msg & “Do you wish to add this Customer? @@Please make sure punctuation and spelling are correct!!”
If MsgBox(Msg, vbQuestion + vbYesNo) = vbNo Then
‘ If the user chose not to add a customer, set the Response
‘ argument to suppress an error message and undo changes.
Response = acDataErrContinue
‘ Display a customized message.
MsgBox “Please select a Customer from the list”
Else
‘ If the user chose to add a new customer, open a recordset
‘ using the Customers table.
Set Db = CurrentDb
Set Rs = Db.OpenRecordset(“tblCustomers”, dbOpenDynaset)‘ Create a new record.
Rs.AddNew
Rs![Customer Name] = NewData
Rs![Customer Order] = “999”
Rs![Report Customer Name] = NewData‘ Save the record.
Rs.Update‘ Set Response argument to indicate that new data is being added.
Response = acDataErrAddedEnd If
Exit_cmbCustomer_NotInList:
Exit Sub
Err_cmbCustomer_NotInList:
‘ An unexpected error occurred, display the normal error message.
MsgBox Err.Description
‘ Set the Response argument to suppress an error message and undo
‘ changes.
Response = acDataErrContinue
End Sub -
WSAccessMan
AskWoody LoungerCharlotte,
I tried what you said about passing the newdata to the ChangeAbbreviations function, and things worked very well – the value changed, the correct value was entered in the table, etc.. However, in the end after the record was added, the Text portion of the combo box was still the original value (before the abbreviations were added). I have tried everything i could think of to change that to the NewData variable, but no matter how i do it, it still tries to call the notinlist event again. If i don’t change the text, then the old value (withouth the abbreviations) is not in the list (which is expected because the abbreviated version is already there). What can i do from this point to iron this situation out? I can post my final code/form if you’d like… -
WSAccessMan
AskWoody LoungerThanks for the tip, Charlotte
I will try what you suggested, but i have one question… What exactly is the difference between a subroutine and a function? If i know what the difference is, i will be able to use the appropriate one in the future when something similar occurs.Thanks for your help and patience
![]() |
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
-
Windows hosting exposes additional bugs
by
Susan Bradley
47 minutes ago -
No more rounded corners??
by
CWBillow
3 hours, 12 minutes ago -
Android 15 and IPV6
by
Win7and10
1 hour, 52 minutes ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
13 hours, 8 minutes ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
15 hours, 50 minutes ago -
Windows 11 Insider Preview Build 26100.4202 (24H2) released to Release Preview
by
joep517
10 hours, 24 minutes ago -
Windows Update orchestration platform to update all software
by
Alex5723
23 hours, 9 minutes ago -
May preview updates
by
Susan Bradley
10 hours, 32 minutes ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
2 hours, 7 minutes ago -
Just got this pop-up page while browsing
by
Alex5723
15 hours, 20 minutes ago -
KB5058379 / KB 5061768 Failures
by
crown
12 hours, 25 minutes ago -
Windows 10 23H2 Good to Update to ?
by
jkitc
1 hour, 44 minutes ago -
At last – installation of 24H2
by
Botswana12
1 day, 14 hours ago -
MS-DEFCON 4: As good as it gets
by
Susan Bradley
1 hour, 43 minutes ago -
RyTuneX optimize Windows 10/11 tool
by
Alex5723
2 days, 2 hours ago -
Can I just update from Win11 22H2 to 23H2?
by
Dave Easley
1 hour, 19 minutes ago -
Limited account permission error related to Windows Update
by
gtd12345
2 days, 16 hours ago -
Another test post
by
gtd12345
2 days, 16 hours ago -
Connect to someone else computer
by
wadeer
2 days, 10 hours ago -
Limit on User names?
by
CWBillow
2 days, 14 hours ago -
Choose the right apps for traveling
by
Peter Deegan
2 days, 3 hours ago -
BitLocker rears its head
by
Susan Bradley
1 day, 11 hours ago -
Who are you? (2025 edition)
by
Will Fastie
1 day, 10 hours ago -
AskWoody at the computer museum, round two
by
Will Fastie
2 days, 6 hours ago -
A smarter, simpler Firefox address bar
by
Alex5723
3 days, 2 hours ago -
Woody
by
Scott
3 days, 12 hours ago -
24H2 has suppressed my favoured spider
by
Davidhs
1 day, 11 hours ago -
GeForce RTX 5060 in certain motherboards could experience blank screens
by
Alex5723
4 days, 2 hours ago -
MS Office 365 Home on MAC
by
MickIver
3 days, 20 hours ago -
Google’s Veo3 video generator. Before you ask: yes, everything is AI here
by
Alex5723
4 days, 16 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.