-
WSjasonsas
AskWoody LoungerThanks Ken for the quick reply. That worked perfectly.
-
WSjasonsas
AskWoody LoungerThanks for the explanation. Try changing
Format([AIP_LatestAIPDate], & Chr(34) & “dd-mm-yyy” & Chr(34)) & (Chr(10))+[tlkpCabAIPDate].[AIPChangeComments]
to
Format([AIP_LatestAIPDate], “”dd-mm-yyy””) & Chr(10)+[tlkpCabAIPDate].[AIPChangeComments]
and similar for the others.
Yes, that’s working now – Thanks Hans, much appreciated.
-
WSjasonsas
AskWoody LoungerWhy do you want to format dates in a query? Excel recognizes dates from Access!
And why do you include line feeds Chr(10) in the dates?HI Hans,
I’m using line feeds because I’m trying to join two fields – Eg, the [AIP_Date] field is actually a combination of the [LatestAIPDate] field and the [AIPChangeComments] field. Because of this, I need to format the dates before they go into Excel.
Hope this makes sense.
Cheers,
Jason -
WSjasonsas
AskWoody LoungerFurther to Hans comments that tell you how to remove the Tab control.
A tab control allows you to have several ‘pages’ within the one form.
Tab controls only have a point when they have more than 1 tab (or page). The db you posted has a form with a tab control that has just one page (tab). In that case it makes sense to follow Hans advice and just remove the tab control and move the other controls directly to the form itself.
However, if the real db has multiple pages (tabs) that option would become complicated as there would be other issues to deal with.Hi Hans and John,
Thanks again for your help. My database does have multiple pages (I just removed for them for the demo I posted), so I think I’ll leave this one for now and let the users know they’ll just have to use the spell check button on the top of the form.
Cheers,
Jason -
WSjasonsas
AskWoody LoungerHans mean the Tab Control on your form:
Hi Francois (and others) – once again, thanks for your help so far, but I’m still not sure what I’m supposed to remove or modify in order to get spell check to work (Also bear in mind that I didn’t design this database from scratch and am also a newbie to Access!)
If I go to the properties of the page (Eg, Proposal page), I don’t see anything mentioned about tabs. If someone can point me in the right direction as to what I need to remove or modify that would be great.
Cheers,
Jason -
WSjasonsas
AskWoody LoungerThe problem appears to be caused by the tab control. If the text boxes are on a tab control, the focus doesn’t shift if you cancel the spell check, but without the tab control, focus does shift.
This appears to be a bug in Access, I don’t know a solution (except doing without the tab control).
Hi guys,
Thanks for your help so far. I’m still trying to figure out why mine doesn’t work, but the example that John posted does work.
When you say tab control, do you mean that you can tab to the fields because they are part of the tab order (View>Tab Order)? If so, John’s example has the same setup but his works, so again I’m not sure why mine doesn’t.
Thanks,
Jason -
WSjasonsas
AskWoody Lounger1) The Find dialog does cycle. It stops when all records have been searched once.
2) To make Access search any part of the field, replace the line
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
with
SendKeys “%ha%n”
RunCommand acCmdFind3) You could place a combo box next to the command button from which the user can select a field. The code would then set focus to the corresponding control instead of to Screen.PreviousControl.
Thanks Hans, that has resolved my issue.
Cheers,
Jason -
WSjasonsas
AskWoody LoungerI attach a demo that uses your code, and works without problem for me.
Does it work for you?
If it does, can you post a similar example that does display the problem you describe?Hi John,
Yes, the demo you attached works for me.
I’ve attached a cut-down copy of my database which just includes a single form and table – I’m still having the problem in this database.
Cheers,
Jason -
WSjasonsas
AskWoody LoungerDo you have other event code for the BillTitle text box? I can’t reproduce the problem that you mention (in Access 2002 SP3) – if I ignore a suggestion or cancel the spell check dialog, the focus moves to the control I clicked in.
HI Hans,
There is no other event code for the BillTitle text box. I’ve also tried this code in another text box (that also does not have any other event code) and I get the same problem. I’m using Access 2003. Any other ideas?
Cheers,
Jason -
WSjasonsas
AskWoody LoungerThanks Hans for helping, that is exactly what I wanted to do.
Cheers,
JasonYou could indeed add a Department column to the Portfolio table.
Then set the Column Count property of the Portfolio combo box on the form to 2.
If you want the user to see the department in the dropdown list, set the Column Widths property to (for example) 1″;1″
If you would prefere the department not to be displayed in the dropdown list, set the Column Widths property to (for example) 1″;0″
A column with width 0 will be hidden.Create an event procedure for the After Update event of the Portfolio combo box:
Code:Private Sub Portfolio_AfterUpdate() Me.Department = Me.Portfolio.Column(1) End Sub
Columns in a combo box or list box are counted starting at 0, so Column(1) is the second column, corresponding to the Department field.
-
WSjasonsas
AskWoody LoungerHave you made the AutoNumber field the primary key of the table? If not, try that.
wow, such a quick reply and it’s actually solved my problem! Thankyou so much, you’re the best!
-
WSjasonsas
AskWoody LoungerIf you want to include a double-quote ” within a quoted string, you have to double it to “”, otherwise VBA interprets it as the end of the string.
Consequently, if you want to include the code for an empty string “” within a quoted string, you have to use “”””.So you have to replace the 10 occurrences of “” in rsSQL with “”””.
Alternatively, you can replace expressions such as
IIf(IsNull(tlkpCabinetCommitteeDate.Comments),””,Chr(13) & Chr(10) & tlkpCabinetCommitteeDate.Comments)
with
(Chr(13) & Chr(10))+tlkpCabinetCommitteeDate.Comments
The + operator when used with strings usually has the same result as & but with one exception: if either of the operands is Null, + results in Null too.
So “Jason” & Null = “Jason”, but “Jason”+Null = Null.
HI Hans, thanks for your help, that fixed the problem!
Cheers,
Jason -
WSjasonsas
AskWoody LoungerSeptember 27, 2009 at 11:04 pm in reply to: Error when trying to update a field in another form #1178952In the query grid when you look at an update query in design view there is a row labelled “Update To” and you select the field you want to update in the top row and then specify the value you want that field updated to as Forms!MyFormName!MyFieldName – you will have to substitute your appropriate names. In your case I think it would be Forms!ProgramMovements!AIP_LatestAIPDate – however your field name be something slightly different, so check that.
Hi guys,
Thanks for all your help so far, I just want to make sure I have this right because I think I might have confused everyone with field names.
What I’m trying to achieve is that when a user enters data into the ‘DeptAIP’ field on the ‘BidDataEnter’ form, I want the ‘LatestAIPDate’ field on the ‘ProgramMovements’ form to be updated. The respective fields and tables that these form fields refer to are ‘AIPProposed_DeptsProposedDate’ in the ‘tblBill’ table and ‘AIP_LatestAIPDate’ in the ‘tblBill’ table – so in this respect, I want it so that when the ‘AIPProposed_DeptsProposedDate’ field is updated in the ‘tblBill’ table, for the ‘AIP_LatestAIPDate’ field in the same table to be updated.
So I’ve created an UpdateQuery (called ‘UpdateLatestAIP’), put ‘AIP_LatestAIPDate’ in the top row (ie, the field in the table I want to update), and put ‘Forms!BidDataEnter!DeptAIP’ in the Update To part (ie, the value in this field should be copied into ‘AIP_LatestAIPDate’). I’ve then gone into the ‘DeptAIP’ field on the ‘BidDataEnter’ form, clicked in the ‘AfterUpdate’ section and put in this code:
Private Sub DeptAIP_AfterUpdate()
DoCmd.OpenQuery “UpdateLatestAIP”, , acReadOnly
End SubThis doesn’t seem to be working however as it says it’s going to update 4 rows and then when I close the form I get a conflict message.
Once again, sorry for not explaining myself properly!
-
WSjasonsas
AskWoody LoungerSeptember 24, 2009 at 6:40 pm in reply to: Error when trying to update a field in another form #1178612The easiest option is probably to create an Update Query, that uses the BillBidInceptionNo from the open form as a parameter.
Do you know how to create update queries?
The After Update event would then just run the query.
Docmd.OpenQuery “qryYourQuery”
Hi John,
I’ve worked out how to create a new query and then change it to an ‘update query’, but not sure how to modify this query so that it accepts data from the field on the form.
-
WSjasonsas
AskWoody LoungerSeptember 24, 2009 at 12:36 am in reply to: Error when trying to update a field in another form #1178506You did indeed ask that question at the start. But if the form had been open, that would have been easier.
You need to be able to identify which record you want the field updated for.
So is there something on the currently open form that identifies which record? Or is there some other way ?Usually you would need to specify a value for the key field in the table you want updated. What is the Key? What type of data is it?
And what type of data is AIP_LatestAIPDate – presumably a Date field.The ‘BillBidInceptionNo’ identifies the record. This is an AutoNumber.
AIP_LatestAIPDate is a Date/Time field.
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
-
KB5061768 update for Intel vPro processor
by
drmark
1 hour, 27 minutes ago -
Outlook 365 classic has exhausted all shared resources
by
drmark
2 hours, 30 minutes ago -
My Simple Word 2010 Macro Is Not Working
by
mbennett555
13 hours, 30 minutes ago -
Office gets current release
by
Susan Bradley
18 hours, 14 minutes ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
1 day, 10 hours ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
19 hours, 17 minutes ago -
Stop the OneDrive defaults
by
CWBillow
1 day, 11 hours ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
1 day, 21 hours ago -
X Suspends Encrypted DMs
by
Alex5723
1 day, 23 hours ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
2 days ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
2 days ago -
OpenAI model sabotages shutdown code
by
Cybertooth
2 days, 1 hour ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
1 day, 13 hours ago -
Enabling Secureboot
by
ITguy
1 day, 20 hours ago -
Windows hosting exposes additional bugs
by
Susan Bradley
2 days, 9 hours ago -
No more rounded corners??
by
CWBillow
2 days, 4 hours ago -
Android 15 and IPV6
by
Win7and10
1 day, 18 hours ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
2 days, 21 hours ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
3 days ago -
Windows 11 Insider Preview Build 26100.4202 (24H2) released to Release Preview
by
joep517
2 days, 18 hours ago -
Windows Update orchestration platform to update all software
by
Alex5723
3 days, 7 hours ago -
May preview updates
by
Susan Bradley
2 days, 18 hours ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
2 days, 10 hours ago -
Just got this pop-up page while browsing
by
Alex5723
2 days, 23 hours ago -
KB5058379 / KB 5061768 Failures
by
crown
2 days, 20 hours ago -
Windows 10 23H2 Good to Update to ?
by
jkitc
1 day, 22 hours ago -
At last – installation of 24H2
by
Botswana12
3 days, 23 hours ago -
MS-DEFCON 4: As good as it gets
by
Susan Bradley
20 hours, 46 minutes ago -
RyTuneX optimize Windows 10/11 tool
by
Alex5723
4 days, 11 hours ago -
Can I just update from Win11 22H2 to 23H2?
by
Dave Easley
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.