-
WSjasonsas
AskWoody LoungerSeptember 23, 2009 at 11:29 pm in reply to: Error when trying to update a field in another form #1178501So you are trying to update a control on a form that is not open? You cannot do that.
If the form is not open, just update the value in the underlying field.Thanks John, I think I asked that question myself in my first reply. Are you able to help with code that would let me update the field in the underlying table, as I’m not sure how to do this. The table name is tblBill and the field is AIP_LatestAIPDate
Cheers,
Jason -
WSjasonsas
AskWoody LoungerSeptember 23, 2009 at 11:06 pm in reply to: Error when trying to update a field in another form #1178497You have made mention of subforms earlier in this thread.
When you want to refer to a control on a subform, you need to use a different syntax than if you refer to a control on a form that is not a subform.
The Forms collection includes all open forms, but not open subforms.So is the control you want to update on a form or a subform?
Hi John,
The control I want to update is on a form – the field is called ‘LatestAIPDate’ and it is on the ‘ProgramMovements’ form.
I mentioned a sub-form earlier because the example code I used works in a sub-form that is on the ‘ProgramMovements’ form. Wendell mentioned that the same code doesn’t work on another form because the ‘ProgramMovements’ form isn’t open when I try to run the code.
Cheers,
Jason -
WSjasonsas
AskWoody LoungerSeptember 23, 2009 at 6:50 pm in reply to: Error when trying to update a field in another form #1178489And what is the relationship of BidDataCenter and ProgramMovements? Is BidDataCenter a subform of ProgramMovements or the other way round or neither?
There is no relationship between BidDataEnter and ProgramMovements.
-
WSjasonsas
AskWoody LoungerSeptember 23, 2009 at 6:08 pm in reply to: Error when trying to update a field in another form #1178482Can you tell us exactly where the controls DeptAIP and LatestAIPDate are, i.e. on which form/subform?
Hi Hans,
DeptAIP is in form “BidDataEnter” and LatestAIPDate is in form “ProgramMovements”
Cheers,
Jason -
WSjasonsas
AskWoody LoungerSeptember 22, 2009 at 10:30 pm in reply to: Error when trying to update a field in another form #1178377In order to update a field on a form, that form must be open. The error message suggests it is not. If the subform is on that form, then the code would work, because the form has to be open in order for the subform to be open. If that is not the case, let us know and we’ll try to help resolve the issue.
Hi Wendel,
Yes, that is the case – the subform is on that form, which is why that code works. Is there another way around this, or should I just update the underlying field in the table itself?
Cheers,
Jason -
WSjasonsas
AskWoody LoungerSeptember 16, 2009 at 10:40 pm in reply to: Field not updating when pop-up calendar is used #1177683Yes, that worked! Thankyou so much for your quick replies!
-
WSjasonsas
AskWoody LoungerWelcome to the Lounge!
The After Update event of CabAppDate only occurs when the user enters or modifies it directly. When the user selects a date in the popup form, the value of CabAppDate is set but its After Update event does not occur, and hence the date on the main form is not modified. So you will have to run the CabAppDate_AfterUpdate explicitly. How to do that depends on the way the popup form and the associated module work.
Hi Hans,
Thanks so much for the quick reply. I’m not much of a programmer, and have copied/pasted etc code from other databases and the web to get everything working! In the ‘On_Dbl_click’ part of the field, I’m calling this code:
=PopupCalendar(Screen.ActiveControl)
Which references the basCalendar module which contains this code:
Option Compare Database ‘Use database order for string comparisons
Option ExplicitConst CALENDAR_FORM = “zsfrmCalendar”
Type udDateType
wYear As Integer
wMonth As Integer
wDay As Integer
End TypePrivate Function isFormLoaded(strFormName As String)
isFormLoaded = SysCmd(SYSCMD_GETOBJECTSTATE, A_FORM, strFormName)
End FunctionFunction PopupCalendar(ctl As Control) As Variant
‘
‘ This is the public entry point.
‘ If the passed in date is Null (as it will be if someone just
‘ opens the Calendar form raw), start on the current day.
‘ Otherwise, start with the date that is passed in.
‘
Dim frmCal As Form
Dim varStartDate As VariantvarStartDate = IIf(IsNull(ctl.Value), Date, ctl.Value)
DoCmd.OpenForm CALENDAR_FORM, , , , , A_DIALOG, varStartDate‘ You won’t get here until the form is closed or hidden.
‘
‘ If the form is still loaded, then get the final chosen date
‘ from the form. If it isn’t, return Null.
‘
If isFormLoaded(CALENDAR_FORM) Then
Set frmCal = Forms(CALENDAR_FORM)
ctl.Value = Format(DateSerial(frmCal!Year, frmCal!Month, frmCal!Day), “dd/mmm/yyyy”)
DoCmd.Close A_FORM, CALENDAR_FORM
Set frmCal = Nothing
End If
End FunctionHope this helps!
Cheers,
Jason
![]() |
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
-
.NET 8.0 Desktop Runtime (v8.0.16) – Windows x86 Installer
by
WSmeyerbos
12 hours, 6 minutes ago -
Neowin poll : What do you plan to do on Windows 10 EOS
by
Alex5723
7 hours, 50 minutes ago -
May 31, 2025—KB5062170 (OS Builds 22621.5415 and 22631.5415 Out-of-band
by
Alex5723
10 hours, 40 minutes ago -
Discover the Best AI Tools for Everything
by
Alex5723
10 hours, 49 minutes ago -
Edge Seems To Be Gaining Weight
by
bbearren
58 minutes ago -
Rufus is available from the MSFT Store
by
PL1
9 hours, 1 minute ago -
Microsoft : Ending USB-C® Port Confusion
by
Alex5723
1 day, 11 hours ago -
KB5061768 update for Intel vPro processor
by
drmark
18 hours, 16 minutes ago -
Outlook 365 classic has exhausted all shared resources
by
drmark
14 hours, 28 minutes ago -
My Simple Word 2010 Macro Is Not Working
by
mbennett555
1 day, 7 hours ago -
Office gets current release
by
Susan Bradley
1 day, 10 hours ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
3 days ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
2 days, 8 hours ago -
Stop the OneDrive defaults
by
CWBillow
3 days, 1 hour ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
3 days, 11 hours ago -
X Suspends Encrypted DMs
by
Alex5723
3 days, 13 hours ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
3 days, 13 hours ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
3 days, 14 hours ago -
OpenAI model sabotages shutdown code
by
Cybertooth
3 days, 14 hours ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
3 days, 2 hours ago -
Enabling Secureboot
by
ITguy
3 days, 9 hours ago -
Windows hosting exposes additional bugs
by
Susan Bradley
3 days, 22 hours ago -
No more rounded corners??
by
CWBillow
3 days, 18 hours ago -
Android 15 and IPV6
by
Win7and10
3 days, 8 hours ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
4 days, 11 hours ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
4 days, 13 hours ago -
Windows 11 Insider Preview Build 26100.4202 (24H2) released to Release Preview
by
joep517
4 days, 8 hours ago -
Windows Update orchestration platform to update all software
by
Alex5723
4 days, 21 hours ago -
May preview updates
by
Susan Bradley
4 days, 8 hours ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
4 days 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.