-
WSkentg
AskWoody Loungerusing the criteria when you open the form is the best way to do this, so stick with what you have. I assume [State] is a long integer? Just a tip but to make your code easier to understand you should be a bit more descriptive with your Field names eg State_ID
in the code you use to add the record add this line –
Code:RunCommand acCmdRecordsGoToNew RunCommand acCmdSaveRecord Forms("frmclientsummary").Requery
That should refresh the form to show the new record
-
WSkentg
AskWoody Loungeror you can just open the query in code to run it but set warnings to false first to suppress the message.
Code:DoCmd.SetWarnings False DoCmd.OpenQuery "qryAppendStuff" DoCmd.SetWarnings True
-
WSkentg
AskWoody LoungerYou could try using the substitue command to create a Z drive. I’ve done this in the past and it works fine.
create a batch file on your desktop
Code:subst z: "c:my Documents"
When you run it you will now have a z drive that is actually pointing to the folder on your machine
-
WSkentg
AskWoody LoungerYou can copy the sql from the append queries you created in the QBE, wrap them in quotes and use them like this –
Code:Dim strSQL As String strSQL = "INSERT INTO Travellers SELECT People.* FROM People" CurrentDb.Execute strSQL
without raising any warnings.
Now the labels wizard not being enabled – most likely it wasn’t installed when you installed office. Try rerunning the install using the customise option and make sure that all the wizards in the Access section are marked to ‘Install on this Machine’. In fact make sure that everything in the Access section is marked to install.
-
WSkentg
AskWoody LoungerWhat about using a continuous form with combo boxes in the header for filtering and command buttons in the header above each column to sort. You can then track the current filters and send them to the report in the criteria. You can use the open arg to send the sort order to the open event of the report
Code:strArg = "Batch_Date DESC" strCriteria = "Batch_Date >= #" & dteFrom & "# AND Batch_Date <= #" & dteTo & "#" DoCmd.OpenReport "rptBatch", acNormal, , strCriteria, , strArg
-
WSkentg
AskWoody LoungerFirst you need to understand that dates are just numbers. In fact they are more or less double, so the time now is 40438.6782638889
Anything to the left of the decimal point is the day, the decimal part is the time.
So if you store just the date, today is 40438.0
To calculate differences you must ensure that you are not being messed around by the time.
Now down to business – This is the kind of thing where Excel is actually better than access. In Excel you can use a formula that compare the value in a cell with the value in a cell in the previous row.
To do the same thing in Access I would use a report with some code in the detail’s format event to set a module level variable and then for each record compare the start date to the variable from the last record then set the variable again.
You can see a simple example in the attached database.
-
WSkentg
AskWoody LoungerControlling interface flow can be challenging and there are many different approaches.
There are so many wasys to control interface flow so here are a couple of tips.
Have you made the forms Modal at design time?
A much better way, is to open them as modal.
Code:DoCmd.OpenForm "frmModal", , , , , acDialog 'do something when frmModal closes
When you do this the code stops and passes to the opened form. The next line won’t execute until the opened form closes.
I only ever use this when there is a specific action required by the user before the process on the parent form can be completed.
Opening reports in preview from a modal form presents considerable challenges but I can’t think of a situation where a user must read a report before they can continue work.
In a situation like, for example where the data doesn’t balance, it’s better to handle that with a form.
When I ever end up in a process like yours, where I have more than one form modal at a time, I take a relook at the workflow and invariable come up with a better process.
By the Way – popup is something I only ever use if I want a little form to float outside of the Access window. You might find you don’t need to set the form’s popup property to true.
-
WSkentg
AskWoody Loungersweet.
-
WSkentg
AskWoody LoungerSeptember 16, 2010 at 8:55 am in reply to: Unbound text/combo boxes with subforms(a few q's #1244723No the existing parent/child links are fine, but you need the month in addition.
-
WSkentg
AskWoody LoungerNice to chat Bob,
Do try out MZ tools – and remember – the best things in life are free, but please don’t tell my clients…
Kent
-
WSkentg
AskWoody LoungerBob,
here my comments on your comments and rant.
1) surely you could write and add in to give this functionality even if someone hasn’t already. I did a quick search but came up empty handed.
In any case I’m much happier using MZ tools to do all this for me.
2) never tried to use it, I’ve never (well not in 15 years) had any macros to convert.
3) Very true, not to mention the impementation of Access Services in 2010. 2010 macros are designed to convert to Java script when they are uploaded to the web. With no interface for a serious developer to modify them.
My add to your rant –
I’ll admit that in my early days I did use the wizards to create code and this did help me go in the directions of code rather than macros. These days I often come across code generated by others less experienced using those wizards, say yuk and clean it up while thinking back to when I did the same.
I love that Access is designed for the information worker, I get most of my work from people like this whos application has grown to be so big and important to their business that they need to get in a real developer. While 95% of the apps started in house will die, there are those few that become mission critical. ANd as long as some of those come to me to cleaup and build on then I have a business.
Access is the best tool for a real developer to create a desktop application but as you point out Microsoft’s commitment to this is sometimes questionable.
It’s OK that information workers use macros, when they are getting an application off the ground, but at some stage the limitations will be reached and VBA is the only answer. (the converter
The fact that Access Services does not have a coding interface eliminates it from serious consideration as a web application. Even if I do manage to create a useable application using macros, at some point, my client will request a feature that is simply not possible using macros. Unhappy client.
Access 2007 was a considerable improvement for the developer trying to distribute an application. It almost got there. Pity MS’s focus was distracted by the sparkly lights of the web when they started on 2010!
SageKey’s installer does fill in all the holes but it’s very expensive. MZ Tools however is free. Here is an example of what two button clicks can insert into your procedure –
Code:On Error GoTo Error_Handler Dim strFormName As String, strCriteria As String, strArg As String strFormName = "" strCriteria = "" strArg = "" DoCmd.OpenForm strFormName, , , strCriteria, , acWindowNormal, strArg Exit_Procedure: On Error Resume Next Exit Sub Error_Handler: Select Case Err.Number Case 0 Case Else MsgBox "Error " & Err.Number & " (" & Err.Description & ") in Procedure: mzTest in Module: ModTest", vbCritical, DBEngine(0)(0).Properties("AppTitle") End Select Resume Exit_Procedure Resume ' For Debugging
Now isn’t that better than the old wizards?
-
WSkentg
AskWoody LoungerSeptember 15, 2010 at 2:53 am in reply to: Unbound text/combo boxes with subforms(a few q's #1244485I had a look at the database you posted, you might like to clean it up a bit and repost to make it easier to work on. Stuff like the naming of fields and controls so that they make sense.
eg fields that relate to each other should have the same name like Team_Command
don’t use ‘Month’ as a field name because it’s a reserved word, use a name like Transaction_Month. I always use at least two words separated by an underscore. That way I can’t possible use a reserved word by mistake.
then name the combo cboTransaction_Month. It’s really hard to follow code that refers to controls with names like ‘combo38’
OK now a couple of pointers.
You can use the Link Master Fields / Link Child Fields to limit the data in a subform as you have done. Unfortunately you can only do this for one field.
You can however use a filter in the Record Source of the subform.
Code:SELECT DSAllocation.*, * FROM DSAllocation WHERE (((DSAllocation.Transaction_Month)=[Forms]![DSMainFrm]![cboTransaction_Month]));
You can do this easily enough using the query builder but you can just paste the above string into the Record Source of DSProductionFrm and it should work, just so long as you rename the combo box to cboTransaction_Month
you can then just requery the subform in the after update of the combo
-
WSkentg
AskWoody Loungerany chance you can post a stripped down database with the forms and just enough data to test with and I’ll check it out.
-
WSkentg
AskWoody LoungerThe code created by the wizards was junk anyway, mostly because of the lousy error handling. Except for maybe the find record in the combo box wizard.
I’ve started using MZ Tools, a free utility for the VBE. Easy to install, let’s you setup error handler code the way you want and inserts it in a procedure with one click even if there is already code in it.
Also lets you customise Procedure headers that insert in a click, code templates and more.
Way better than the code generating wizards.
And certainly better than using macros.
-
WSkentg
AskWoody LoungerMy Mother taught me that if I ever used SendKeys, I would surely go straight to hell.
I’ve recently had to do something similar and here’s what I did.
Create module level variables for the fields you want to carry over.
Set them in the after update event of the form
in the on insert event, populate the controls from the module level variables.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
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
-
W11 23H2 April Updates threw ‘class not registered’ (Awaiting moderation)
by
WindowsPersister
2 hours, 19 minutes ago -
TotalAV safety warning popup
by
Theodore Nicholson
6 hours, 42 minutes ago -
two pages side by side land scape
by
marc
1 day, 6 hours ago -
Deleting obsolete OneNote notebooks
by
afillat
1 day, 8 hours ago -
Word/Outlook 2024 vs Dragon Professional 16
by
Kathy Stevens
10 hours, 58 minutes ago -
Security Essentials or Defender?
by
MalcolmP
13 hours, 42 minutes ago -
April 2025 updates out
by
Susan Bradley
1 hour, 45 minutes ago -
Framework to stop selling some PCs in the US due to new tariffs
by
Alex5723
7 hours, 3 minutes ago -
WARNING about Nvidia driver version 572.83 and 4000/5000 series cards
by
Bob99
5 hours, 58 minutes ago -
Creating an Index in Word 365
by
CWBillow
23 hours, 39 minutes ago -
Coming at Word 365 and Table of Contents
by
CWBillow
15 hours, 8 minutes ago -
Windows 11 Insider Preview Build 22635.5170 (23H2) released to BETA
by
joep517
2 days, 3 hours ago -
Has the Microsoft Account Sharing Problem Been Fixed?
by
jknauth
2 days, 6 hours ago -
W11 24H2 – Susan Bradley
by
G Pickerell
2 days, 8 hours ago -
7 tips to get the most out of Windows 11
by
Alex5723
2 days, 6 hours ago -
Using Office apps with non-Microsoft cloud services
by
Peter Deegan
1 day, 23 hours ago -
I installed Windows 11 24H2
by
Will Fastie
6 hours ago -
NotifyIcons — Put that System tray to work!
by
Deanna McElveen
2 days, 11 hours ago -
Decisions to be made before moving to Windows 11
by
Susan Bradley
46 minutes ago -
Port of Seattle says ransomware breach impacts 90,000 people
by
Nibbled To Death By Ducks
2 days, 20 hours ago -
Looking for personal finance software with budgeting capabilities
by
cellsee6
2 days, 4 hours ago -
ATT/Yahoo Secure Mail Key
by
Lil88reb
2 days, 4 hours ago -
Devices with apps using sprotect.sys driver might stop responding
by
Alex5723
3 days, 13 hours ago -
Neowin – 20 times computers embarrassed themselves with public BSODs and goofups
by
EP
3 days, 21 hours ago -
Slow Down in Windows 10 performance after March 2025 updates ??
by
arbrich
2 days, 23 hours ago -
Mail from certain domains not delivered to my outlook.com address
by
pumphouse
3 days, 6 hours ago -
Is data that is in OneDrive also taking up space on my computer?
by
WShollis1818
3 days, 16 hours ago -
Nvidia just fixed an AMD Linux bug
by
Alex5723
5 days, 8 hours ago -
50 years and counting
by
Susan Bradley
2 days, 6 hours ago -
Fix Bluetooth Device Failed to Delete in Windows Settings
by
Drcard:))
2 days, 9 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.