-
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!
![]() |
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
-
April 2025 Office non-Security updates
by
PKCano
44 minutes ago -
Microsoft wants to hear from you
by
Will Fastie
1 hour, 56 minutes ago -
Windows 11 Insider Preview Build 22635.5160 (23H2) released to BETA
by
joep517
4 hours, 17 minutes ago -
Europe Seeks Alternatives to U.S. Cloud Providers
by
Alex5723
9 hours, 48 minutes ago -
Test post
by
Susan Bradley
12 hours, 1 minute ago -
Used Systems to delete Temp files Gone WRONG what does this mean?
by
Deo
13 hours, 43 minutes ago -
SSD shuts down on its own
by
CWBillow
5 hours, 7 minutes ago -
OneDrive File Sharing Changes
by
David Clark
21 hours, 46 minutes ago -
OneDrive File Sharing Changes
by
David Clark
23 hours, 50 minutes ago -
Win 10 Pro 22H2 to Win 11 Pro 23H2 Conversion Guide
by
doneager
13 minutes ago -
Today is world backup day
by
Alex5723
15 hours, 27 minutes ago -
Windows .exe on Mint
by
Slowpoke47
1 day, 1 hour ago -
Reviewing your licensing options
by
Susan Bradley
11 hours, 8 minutes ago -
Apple has been analyzing your photos since September 2024
by
B. Livingston
28 minutes ago -
What Windows 11 24H2 offers beyond bugs
by
Lance Whitney
4 hours, 27 minutes ago -
Making sense of Settings in Windows 11
by
Simon Bisson
11 hours, 40 minutes ago -
Windows 11 pro fails to log in after upgrading Win 10 pro to Win 11 pro 24h2
by
ben_sitaud
21 hours, 39 minutes ago -
23H2 / 24H2 / Local v. Microsoft Account.
by
CWBillow
19 hours, 26 minutes ago -
YouTube Ad Blocker Blocker
by
bbearren
19 hours, 37 minutes ago -
Obscure historical facts about Windows
by
Cybertooth
21 hours, 15 minutes ago -
Microsoft Backup
by
Linda2019
12 hours, 59 minutes ago -
What is the best notepad++ version for W7?
by
Picky
20 hours, 29 minutes ago -
What are right steps to move MS 365 Office+OneDrive files from PC to iMac?
by
glnz
2 days, 6 hours ago -
How to move existing MS 365 Office with OneDrive files from PC to new iMac
by
glnz
2 days, 6 hours ago -
How to move MS 365 files (some on OneDrive) from PC to iMac
by
glnz
3 days, 1 hour ago -
Microsoft adding Quick Machine Recovery to Windows 11
by
Alex5723
3 days, 1 hour ago -
Microsoft vs Passwords
by
Alex5723
8 hours, 52 minutes ago -
Windows 11 Insider Preview build 26200.5516 released to DEV
by
joep517
3 days, 5 hours ago -
Windows 11 Insider Preview build 26120.3653 (24H2) released to BETA
by
joep517
3 days, 5 hours ago -
Two March KB5053606 updates?
by
Adam
2 days, 22 hours 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.