-
WSase001
AskWoody LoungerDarn it – simple settings check would have resolved this…apologies.
Tools>Options>General> make sure error trapping is set as ‘Break on Unhandled Errors’
-
WSase001
AskWoody LoungerThanks Paul No there is no column with a space in it..however, I have just managed to solve it.
The problem arises when the formatting of the column is indented and vertical centre.
I set the formatting to left basic cells and the column now saves as csv without the trailing space.bit of a gotcha problem with the formatting dictating the resulting csv output.
thanks for checking Paul.
-
WSase001
AskWoody LoungerThe LEFT function is a red herring!
I have a module in the database that declares a function completely unrelated to the Left/Right/Mid and I had overlooked it when including PtrSafe in the ‘Declare Function’ script.As soon as I changed it to ‘Declare PtrSafe Function’ then the code and queries run fine once more.
thanks PATT, appreciate the quick jump in on this.
Sounds like I gotta bit of catching up to do with other macros and databases now. -
WSase001
AskWoody LoungerThe code is actually in the query field in this particular instance and is:
“Left([sort_code],2) & Mid([sort_code],4,2) & Right([sort_code],2) AS S_C,”all pretty basic run of the mill, but the left/right/mid causes the compile error
-
WSase001
AskWoody LoungerAlan,
Using math is a very good idea and the only way I think you’ll solve this problem. Here’s my take on that approach.
SQL:Code:SELECT aseOrders.Order_Ref, aseOrders.YearS, aseOrders.Period, aseOrders.Session FROM aseOrders WHERE (((aseOrders.YearS)=2014) AND ((([Period]*1000)+[Session])>=7004 And (([Period]*1000)+[Session])<=8001));
Access Query Design:
38390-aseQDJPG
Results:
38391-aseResults
Note: The results show the calculated field for reference only as you'll note both the SQL and Query Design omit that field!Note2: I multiplied the Period by 1000 before adding in the Session to avoid any rollover results since I didn't know how many Periods or Sessions you had.
HTH :cheers:
that certainly helps a lot thanks! Very much appreciated :cheers:
-
WSase001
AskWoody LoungerThanks RG
partial table for illustrative purposes is:
Order_Ref YearS Period Session
W15 2014 7 1
W16 2014 7 1
W17 2014 7 1
W18 2014 7 1
W19 2014 7 4
W20 2014 7 4
W21 2014 7 4
W22 2014 7 4
W23 2014 7 4
W24 2014 7 4
W25 2014 8 1Using the parameters of greater than/= period 7 session 1 and less than/= period 8 session 1
should return all lines of data, which it does
But if I want to see only those records where the parameters are greater than/= period 7 session 4 and less than/= period 8 session 1
I get nil returns when actually I am expecting to see Order_refs W19 to W25 incl.Hope that helps.
I am considering using math to make the period 7 session 1 into say 71 and use that ?
thanks
Alan -
WSase001
AskWoody LoungerJune 12, 2013 at 11:51 am in reply to: workbook links updating strange behaviour – Excel 2010 SP1 #1396519Thanks, been a long busy few weeks so just back on this.
Yep, all users have same mappings at logon and having checked their sessions the mappings are remaining in place.
I have tried the files in a controlled area and have found:
File1 – links to file2 using the mapped drive definition, e.g. M:alanfile2.xlsx
File1 also links to file2 using the unc of \manccommonalanfile2.xlsxWith file2 open I changed a couple of values
Did not save file2
changed view to File1
the cells which referred to the mapped drive have updated immediately
the cells which referred to the unc location have not updated at all
I did not select to update links, just switched views to the File1In File1, I now selected Dat>Edit Links
Both paths are indicated as containing links to external files.
I select the mapped drive link and select update (I know the data has already appeared in my file, but I selected it anyway)I select the unc link and select update – and although the link status says OK, the data on the worksheet is not updated (I guess until I SAVE the file2)
Strange goings on, and pretty disconcerting if multiple users are using the files.
Anyone else have similar experience?
TIA
Alan -
WSase001
AskWoody LoungerWe are experiencing this problem with virtualised servers and excel 2010 files.
Link formulas cells return #REF! and on other occassions return maybe a 0 instead.
I cannot repeat the error on demand but using the replace option of replacing “=” with “=” refreshes the link and hopefully returns the correct value.
In financial terms this is priority 1 serious with incorrect sums already having been reported to powers that be.Need a fix asap so it’s all hands on deck till it’s fixed.
-
WSase001
AskWoody LoungerThanks Guys, the sql was very basic where 1 query was linked on one to one join with another query based on a text field.
One of those queries that you take down to a single field and it still didn’t work.
The answer – Index the linked field in the audit query.SQL below resulted in an invalid operation
Code:SELECT [Find duplicates for dbo_TimesheetsB].Timesheet_Number, qry_Timesheets_Audit.Row_Id FROM qry_Timesheets_Audit RIGHT JOIN [Find duplicates for dbo_TimesheetsB] ON qry_Timesheets_Audit.Row_Id = [Find duplicates for dbo_TimesheetsB].Timesheet_Number;
the SQL below works without error – exactly same SQL
Code:SELECT [Find duplicates for dbo_TimesheetsB].Timesheet_Number, qry_Timesheets_Audit.Row_Id FROM qry_Timesheets_Audit RIGHT JOIN [Find duplicates for dbo_TimesheetsB] ON qry_Timesheets_Audit.Row_Id = [Find duplicates for dbo_TimesheetsB].Timesheet_Number;
-
WSase001
AskWoody LoungerWeirdly enough, the parameters are in an earlier query which feeds the end query, but I added the following in:
Code:Set qdf = db.QueryDefs(“qry_MT103_Output”) For Each prm In qdf.Parameters prm.Value = Eval(prm.Name) Next prm
then used:
Code:Set rs = qdf.OpenRecordset(dbOpenSnapshot)
and I get a result without the Too few parameters error.
-
WSase001
AskWoody LoungerForgot to add: form parameters are in the style of:
[Forms]![frm_Choice]![cmbEmployerRef]where cmbEmployerRef is a drop down selection on the form ‘frmChoice’
-
WSase001
AskWoody LoungerThanks John,
specified the parameters at the start so I thought that would not be part of this problem, so I then wrote the criteria direct into the query and removed the query parameters.
the export worked fine when using no form parameters.
Entering 1 form sourced parameter causes the code to error with “Too few parameters Expected:1”, so the error is being driven by the number of parameters in the actual query.the query is not being coded in the vba but is a standard query.
short section of code in the vba is:
Code:Dim strfile As String Dim intOutputfile As Integer Dim strOutput As String Dim db As dao.Database Dim rs As dao.Recordset Set db = CurrentDb strfile = “H:test4.txt” intOutputfile = FreeFile Open strfile For Output As #intOutputfile Set rs = db.OpenRecordset(“qry_MT103_Output”, dbOpenDynaset)
the final line above is the point of the debug error
Cheers
-
WSase001
AskWoody LoungerMarch 19, 2012 at 5:44 am in reply to: MT103 files and exporting individual records to text files #1325663Many thanks John, great starter to exactly what I need. Really appreciated.
Alan -
WSase001
AskWoody Loungerthanks Rory. I’ve implemented the calc for counting each indiivdual element of y/m/d rather than relying on datedif.
I did notice however that the error crept in when the start day date was of a greater figure than the current day date…i.e. if the original date was 10/01/2011 then the result for todays date was 1 year, 0 month and 1 day
but if the original date was 12/01/2011 then the result was 0 year, 11 month and 194 daysCheers
Alan -
WSase001
AskWoody LoungerThanks Guys, just trawling through the database now to check and correct.
Didn’t help that the 2008SM was installed blindly with nothing checked.
Thanks again.
alan
![]() |
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
-
Proton to drop prices after ruling against “Apple tax”
by
Cybertooth
6 hours, 12 minutes ago -
24H2 Installer – don’t see Option for non destructive install
by
JP
6 hours, 38 minutes ago -
Asking Again here (New User and Fast change only backups)
by
thymej
17 hours, 33 minutes ago -
How much I spent on the Mac mini
by
Will Fastie
7 hours ago -
How to get rid of Copilot in Microsoft 365
by
Lance Whitney
1 minute ago -
Spring cleanup — 2025
by
Deanna McElveen
23 hours, 25 minutes ago -
Setting up Windows 11
by
Susan Bradley
1 hour, 48 minutes ago -
VLC Introduces Cutting-Edge AI Subtitling and Translation Capabilities
by
Alex5723
18 hours, 53 minutes ago -
Powershell version?
by
CWBillow
19 hours, 46 minutes ago -
SendTom Toys
by
CWBillow
4 hours, 2 minutes ago -
Add shortcut to taskbar?
by
CWBillow
23 hours, 41 minutes ago -
Sycophancy in GPT-4o: What happened
by
Alex5723
1 day, 16 hours ago -
How can I install Skype on Windows 7?
by
Help
1 day, 14 hours ago -
Logitech MK850 Keyboard issues
by
Rush2112
21 hours, 41 minutes ago -
We live in a simulation
by
Alex5723
2 days, 6 hours ago -
Netplwiz not working
by
RetiredGeek
1 day, 16 hours ago -
Windows 11 24H2 is broadly available
by
Alex5723
2 days, 18 hours ago -
Microsoft is killing Authenticator
by
Alex5723
1 day, 6 hours ago -
Downloads folder location
by
CWBillow
3 days, 1 hour ago -
Remove a User from Login screen
by
CWBillow
1 day, 20 hours ago -
TikTok fined €530 million for sending European user data to China
by
Nibbled To Death By Ducks
2 days, 16 hours ago -
Microsoft Speech Recognition Service Error Code 1002
by
stanhutchings
2 days, 16 hours ago -
Is it a bug or is it expected?
by
Susan Bradley
18 hours, 20 minutes ago -
Image for Windows TBwinRE image not enough space on target location
by
bobolink
2 days, 15 hours ago -
Start menu jump lists for some apps might not work as expected on Windows 10
by
Susan Bradley
1 day, 14 hours ago -
Malicious Go Modules disk-wiping malware
by
Alex5723
3 days, 5 hours ago -
Multiple Partitions?
by
CWBillow
3 days, 5 hours ago -
World Passkey Day 2025
by
Alex5723
2 hours, 38 minutes ago -
Add serial device in Windows 11
by
Theodore Dawson
4 days, 14 hours ago -
Windows 11 users reportedly losing data due forced BitLocker encryption
by
Alex5723
2 days, 15 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.