-
WSAlexya1
AskWoody Lounger(Edited by WendellB on 01-May-03 08:01. activate link – see Help 19)
Help!… I can’t stop looking for this now… (When I get a question in my head… look out!!… )
I wasn’t sure whether that file would help you or not… so I found this code at: http://www.erlandsendata.no/english/vba/pr…angeprinter.php%5B/url%5D
‘Change the default printer
‘This example macro shows how to print a selected document to another printer then the default printer.
‘This is done by changing the property Application.ActivePrinter :Sub PrintToAnotherPrinter()
Dim STDprinter As String
STDprinter = Application.ActivePrinter
Application.ActivePrinter = “microsoft fax on fax:”
‘ change printer
ActiveSheet.PrintOut
‘ prints the active sheet
Application.ActivePrinter = STDprinter
‘ change back to standard printer
End SubLet me know how it goes…
-
WSAlexya1
AskWoody Lounger(Edited by HansV to make URL live – see Help 19)
Good Morning David…
I have never had to do this, but I was sure that I’d seen how to somewhere… Doing a search on Google for “vba changing printer” came up with numerous hits… I found the attached file at : http://www.mcwtech.com/downloads.htm%5B/url%5D
It’s an mdb done in Access 97 and I’m sure you’ll have to adapt it… but hopefully it’ll help…
Have a great day!
-
WSAlexya1
AskWoody LoungerThanks Aladin!
I tried your solution and it worked great except one thing… I failed to mention that the non-zero dollar amounts can be negative… There was one row with a negative value and that was the only one that returned an incorrect RegionID… I think the MAX stuff is where the problem is, but I’m not sure how I’d fix it… I’ll try and figure it out, for future reference…
Have a great day!
-
WSAlexya1
AskWoody LoungerThanks Hans! You’re the best!
I tweaked it a bit for other tests I had to do but it works perfectly… AND I learned a couple more Excel functions in the process…
That’s always a good thing… Thanks again! Have a great day!
-
WSAlexya1
AskWoody LoungerHmmm…. Well my first thought is this….
I’m assuming the Inmate and Meds Tables are “Inner” joined in the query in question… That would show only the inmates showing in the Meds and Inmate tables… I would change the join to a Left Join (using the Inmate table as the primary table) … That would show ALL Inmates… whether they matched the Meds table or not… Then create a new field in the query, to put the None in…
For example:
fldMedsOrdered = IIf(IsNull(fldMeds), “None”, fldMeds)Does that help at all? (I hope I didn’t completely misunderstand the issue…
)
-
WSAlexya1
AskWoody LoungerThanks Charlotte… I should have known better… lol…
-
WSAlexya1
AskWoody LoungerDo you have a button for saving the new record?? … If not, my suggestion would be to put a quick validation routine in the Form Unload event…
Maybe something like:Private Sub Form_Unload(Cancel As Integer)
Dim ctl As Control
Dim blnMissingData As BooleanFor Each ctl In Me.Controls
If ctl.ControlType = acTextBox Then
If IsNull(ctl) Or ctl = “” Then
blnMissingData = True
End If
End If
Next ctlIf blnMissingData Then
MsgBox “Data missing, please ensure all required fields are complete… Record will not be saved as is… ”
‘set the focus back to the first text box
Cancel = True
blnMissingData = False
End IfEnd Sub
Now this routine will check all text boxes for data… Obviously it’ll need adapting if you only have certain controls that are mandatory… but hopefully this will give you an idea…
Have a great day!
HTH
-
WSAlexya1
AskWoody LoungerFebruary 14, 2003 at 8:41 pm in reply to: One to many – Multiple field keys (Access 2002/SP2) #653771Hi there…
This MAY be a waste of time since I only have Access 97 SR2 at work, but I’ll give you this answer and hope it’s close to how you do it in that version.
k… I’ve attached an example for you to see… Here’s how I do it…
1) For the One side of your relationship… from table design mode… you just select both fields (rows in the fld definitions) that will make up the key, right click and select primary key… (Make sure the indexing is as you want it…) … You should see the key next to both field names… Save the table design…
2) Then in the Many side… table design mode… Ensure that the two corresponding have indexing “Yes (Duplicated Ok)” … Save the table design…
3) Then add both tables… in order (tblOne first, then tblMany) to the relationships window… Drag the first field of the primary key in the One table over to the first foreign key in the Many table… A window should pop up where you define the relationships…. Fill in the second field of the primary key and the corresponding one in the Many table… Check the “Enforce Referential Integrity” option… Click OK… As soon as the window disappears you should see the symbols for One-To-Many relationships in both places…All done…
Hope this makes sense… and HOPE it works the same in 2002… Let me know how it goes… I don’t get the opportunity to answer questions on here often…
-
WSAlexya1
AskWoody LoungerHi Andrew…
Any particular reason why you don’t just update the old records with the new information?… (rather than deleting them and adding new ones)
-
WSAlexya1
AskWoody LoungerOkay… This may be a realllllllllyyy silly response… but whenever that kind of thing happens for no apparent reason
,I start thinking possible corruption…
Have you tried compacting/repairing or maybe importing everything into a new blank mdb?? …Sometimes that works for me… It’s just a thought…HTH
-
WSAlexya1
AskWoody LoungerOops… Almost forgot… The “Expected 1” part of the message means just that… There is 1 field it is looking for a value for…
-
WSAlexya1
AskWoody LoungerThis message means that you are neglecting to give Access a value that it needs for execution… I have copied the help information from Access 97 so that you can read it for yourself…
“Too few parameters. Expected . (Error 3061)
This parameter query requires the specified number of parameters, which you didn’t supply. Provide the expected number of parameters, and run the query again.
In some cases, this message is generated when unknown field names or expressions are interpreted as query parameters. Be sure to enclose field names containing spaces or punctuation with square brackets [ ]. ”Check the fields and expressions in your query design and see if there is a field name you mistyped (or that doesn’t exist anymore), etc….
Hope this helps… but if not… try posting the SQL view and maybe that would be easier to help you with…
Happy Friday! -
WSAlexya1
AskWoody LoungerWell this is a new one for me… I know I don’t have half the experience of many people here… but I’ve never seen a query that updated more than one table at once…. Unless the job is done with relationships among the tables??
Sounds to me like you need to create some relationships with referential integrity enforced….
Also… the delete query you were talking about…. does that mean you just want the customer number to be deleted and the field left blank, but the records to remain?…. or do you want any and all records in all three tables for that customer number deleted simultaneously?
-
WSAlexya1
AskWoody LoungerStewart… You’re a lifesaver!!
I thought Hans’ idea about bringing the file into Excel was working… but I ran into a few problems with that… 1) It would only allow me to import 16,384 records from the .xls file…. (the table has over 20,000) … and 2) For some reason beyond me, Excel was formatting a text field (even though I had created an import spec… Strange but true)… and that was resulting in a lot of queries not working… joins, etc…
Anyway…. I tried fixing the file with your code and it worked perfectly…. Thank you so much for your help….
-
WSAlexya1
AskWoody LoungerOops… Mark beat me to it….
Have a great day!
![]() |
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
-
Thunderbird release notes for 128 esr have disappeared
by
EricB
1 hour, 47 minutes ago -
CISA mutes own website, shifts routine cyber alerts to X, RSS, email
by
Nibbled To Death By Ducks
2 hours, 15 minutes ago -
Apple releases 18.5
by
Susan Bradley
2 hours, 35 minutes ago -
Fedora Linux 40 will go end of life for updates and support on 2025-05-13.
by
Alex5723
3 hours, 41 minutes ago -
How a new type of AI is helping police skirt facial recognition bans
by
Alex5723
4 hours, 19 minutes ago -
Windows 7 ISO /Windows 10 ISO
by
ECWS
11 hours, 15 minutes ago -
No HP software folders
by
fpefpe
12 hours ago -
Which antivirus apps and VPNs are the most secure in 2025?
by
B. Livingston
4 hours, 13 minutes ago -
Stay connected anywhere
by
Peter Deegan
17 hours, 23 minutes ago -
Copilot, under the table
by
Will Fastie
8 hours, 36 minutes ago -
The Windows experience
by
Will Fastie
23 hours, 37 minutes ago -
A tale of two operating systems
by
Susan Bradley
14 hours, 33 minutes ago -
Microsoft : Resolving Blue Screen errors in Windows
by
Alex5723
1 day, 4 hours ago -
Where’s the cache today?
by
Up2you2
1 day, 20 hours ago -
Ascension says recent data breach affects over 430,000 patients
by
Nibbled To Death By Ducks
1 day, 13 hours ago -
Nintendo Switch 2 has a remote killing switch
by
Alex5723
13 hours, 23 minutes ago -
Blocking Search (on task bar) from going to web
by
HenryW
1 day, 20 hours ago -
Windows 10: Microsoft 365 Apps will be supported up to Oct. 10 2028
by
Alex5723
2 days, 13 hours ago -
Add or Remove “Ask Copilot” Context Menu in Windows 11 and 10
by
Alex5723
2 days, 13 hours ago -
regarding april update and may update
by
heybengbeng
2 days, 15 hours ago -
MS Passkey
by
pmruzicka
1 day, 17 hours ago -
Can’t make Opera my default browser
by
bmeacham
2 days, 22 hours ago -
*Some settings are managed by your organization
by
rlowe44
2 days, 9 hours ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
2 days, 21 hours ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
3 days, 17 hours ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
4 days, 2 hours ago -
AI slop
by
Susan Bradley
1 day, 20 hours ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
4 days, 3 hours ago -
Two blank icons
by
CR2
1 day, 11 hours ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
1 day, 13 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.