-
WSsimmo7
AskWoody LoungerHere’s how I do it. I keep a table with the SQL for each query. In the Where clause of each SQL, I stick something like “AND 0=0”. For example, your query would have this:
WHERE (((t_survey.survey_date) Is Null) AND ((t_survey.report_completed_date) Is Null)) AND 1=1
Prior to calling the report, I use the Replace function to replace “1=1” with whatever I want (like “Surveyor=12345”) and then replace the SQL in the query behind the report. In your case, I’d cycle through the Surveyor table and run the report for each Surveyor. This way, you can use the Output to PDF functionality within Access.
Mark,
Can you give a little bit more detail on this, my Surveyor field is a concatenation of first_name and surname and is stored as text. In my SQL, this is the first part of the statement SELECT [t_surveyor]![first_name] & ” ” & [t_surveyor]![surname] AS Surveyor. How do I get it to loop through the Surveyor field in the query?
-
WSsimmo7
AskWoody LoungerThanks RG, Yes, I did include the SwitchPrinters() code in the project and PDF Creator is installed. I may need to get on to my IT department, as I cannot get into the PDF configuration file to make any changes. I will keep trying though.
Regards,
Maria. -
WSsimmo7
AskWoody LoungerRG, I keep getting a compile error at the following part of the code. strDfltPrt – I get ByRef Argument type mismatch. Any ideas?
-
WSsimmo7
AskWoody LoungerThanks, RG, I will try this out shortly and let you know how I get on.
-
WSsimmo7
AskWoody LoungerI have just checked our system and we do have PDF Creator. I would only need to change the code to not send emails and just save each surveyor’s report as a separate PDF to a specified subdirectory, with the file name to include the Surveyor name and current date from the Surveyor field in the query.
-
WSsimmo7
AskWoody LoungerThanks for that RetiredGeek, how would I modify this to not use ClearPDF as a printer and to not use Outlook – there are no email addresses in the report?
-
WSsimmo7
AskWoody LoungerJuly 27, 2015 at 11:28 pm in reply to: Populate Cells Based on Matched Criteria and Enter Value From Another Cell #1517372Why not just use =VLOOKUP(C2,F3:J367,5,0) – this seems to much simpler that the other suggested formulae.
Regards,
Maria -
WSsimmo7
AskWoody LoungerHi Mike,
Insert a new column to the right of your credit card numbers and if Your credit card numbers are in column A, then in the new column B enter the following formula =LEFT(A1,4)&”-“&MID(A1,6,4)&”-“&MID(A1,11,4)&”-“&RIGHT(A1,4) and copy down the range of your data. you can then either hide column A or convert all formulae in column B to values and delete column A.
Regards,
Maria -
WSsimmo7
AskWoody LoungerThanks Steve, I just tested with the error handling and it worked, no debug mode triggered. Just what I wanted. I am not sure if your alternate method would work as the 2 pivot tables are created by the macro they do not already exist. I import data on a weekly basis from our mainframe to a new worksheet and format as needed then run the addPivotTables macro.
Regards,
Maria -
WSsimmo7
AskWoody LoungerI use the Wingdings characters 251 & 252 in the following macro’s.
Code:Sub XMark()
‘
‘ XMark Macro
‘ Insert X in Wingdings font
‘‘
ActiveCell.FormulaR1C1 = “û”
With Selection.Font
.Name = “Wingdings”
.Size = 14
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End WithWith Selection
.HorizontalAlignment = xlCenter
End With
ActiveCell.Offset(0, 1).Select
End Sub
Sub TickMark()
‘
‘ TickMark Macro
‘ Insert Tick in Wingdings Font
‘‘
ActiveCell.FormulaR1C1 = “ü”
With Selection.Font
.Name = “Wingdings”
.Size = 14
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End WithWith Selection
.HorizontalAlignment = xlCenter
End With
ActiveCell.Offset(0, 1).Select
End SubYou can then modify to use the colours you want.
Regards,
Maria -
WSsimmo7
AskWoody LoungerAnother way is when in Table design, simply set the format for the field to show >, this will force every entry into the field to uppercase.
Regards,
Maria -
WSsimmo7
AskWoody LoungerJust a little point, I find it better to save files with dates using Year-Month-Day – this makes files easier to sort into date order.
Regards,
Maria -
WSsimmo7
AskWoody LoungerArcturus 16a,
In Excel 2007, right click on the field and go to field settings, change from Show item labels in tabular form to show item labels in outline form and make sure both boxes are checked.
-
WSsimmo7
AskWoody LoungerHi Trevor,
Is the report based on an Access query? If so, I would put a criteria in the query under the order number field as = not null.
Regards,
Maria -
WSsimmo7
AskWoody LoungerThanks Maud,
This will be very helpful. Quite often, I need to hide empty columns after I have deleted some content and then unhide them after I have printed out the content I need. I can’t simply delete the empty columns as they would still be needed if data needs to be entered for those columns.
Regards,
Maria
![]() |
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
-
Key, Key, my kingdom for a Key!
by
RetiredGeek
1 hour, 37 minutes ago -
Registry Patches for Windows 10
by
Drcard:))
6 hours, 8 minutes ago -
Cannot get line length to NOT wrap in Outlining in Word 365
by
CWBillow
6 hours, 20 minutes ago -
DDU (Display Driver Uninstaller) updates
by
Alex5723
2 hours, 49 minutes ago -
Align objects on a OneNote page
by
CWBillow
11 hours, 36 minutes ago -
OneNote Send To button?
by
CWBillow
12 hours, 20 minutes ago -
WU help needed with “Some settings are managed by your organization”
by
Peobody
20 hours, 53 minutes ago -
No Newsletters since 27 January
by
rog7
16 hours, 49 minutes ago -
Linux Mint Debian Edition 7 gets OEM support, death of Ubuntu-based Mint ?
by
Alex5723
1 day, 1 hour ago -
Windows Update “Areca Technology Corporation – System – 6.20.0.41”
by
Bruce
1 hour, 57 minutes ago -
Google One Storage Questions
by
LHiggins
6 hours, 8 minutes ago -
Button Missing for Automatic Apps Updates
by
pmcjr6142
7 hours, 12 minutes ago -
Ancient SSD thinks it’s new
by
WSila
2 hours, 1 minute ago -
Washington State lab testing provider exposed health data of 1.6 million people
by
Nibbled To Death By Ducks
1 day, 11 hours ago -
WinRE KB5057589 fake out
by
Susan Bradley
1 day, 5 hours ago -
The April 2025 Windows RE update might show as unsuccessful in Windows Update
by
Susan Bradley
19 hours, 39 minutes ago -
Firefox 137
by
Charlie
15 hours, 58 minutes ago -
Whisky, a popular Wine frontend for Mac gamers, is no more
by
Alex5723
2 days ago -
Windows 11 Insider Preview build 26120.3863 (24H2) released to BETA
by
joep517
2 days ago -
Windows 11 Insider Preview build 26200.5551 released to DEV
by
joep517
2 days ago -
New Windows 11 PC setup — can I start over in the middle to set up a local id?
by
ctRanger
20 hours, 8 minutes ago -
Windows 11 Insider Preview Build 26100.3902 (24H2) released to Release Preview
by
joep517
2 days, 3 hours ago -
Oracle kinda-sorta tells customers it was pwned
by
Nibbled To Death By Ducks
2 days, 9 hours ago -
Global data centers (AI) are driving a big increase in electricity demand
by
Kathy Stevens
2 days, 20 hours ago -
Office apps read-only for family members
by
b
2 days, 22 hours ago -
Defunct domain for Microsoft account
by
CWBillow
2 days, 19 hours ago -
24H2??
by
CWBillow
20 hours, 1 minute ago -
W11 23H2 April Updates threw ‘class not registered’
by
WindowsPersister
15 hours, 55 minutes ago -
Master patch listing for April 8th, 2025
by
Susan Bradley
19 hours, 52 minutes ago -
TotalAV safety warning popup
by
Theodore Nicholson
1 day, 19 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.