-
WSJenniferS
AskWoody LoungerSo you’re saying that I should go into properties of the field on my “Invoice” form and change “Name” to something else that is different from the “Control Source”?
Jen
-
WSJenniferS
AskWoody LoungerWell, I got past that problem, but then I got a run-time error on the [txtInvID]. What does that whole line mean anyway?
.Filter = “[InvID]=” & [InvID] & “”
That is the big problem I have with Access. I never really know what each line (or property) does.
Jennifer
-
WSJenniferS
AskWoody LoungerOkay, Charlotte. Call me a complete untechnical weenie, but I don’t understand “techie” lingo. What is “IDE” and what is the project explorer? Sorry.
Jennifer
-
WSJenniferS
AskWoody LoungerI still can’t get it to work. It still gives me a compile error. When it does that it hightlights the first and the fifth line. Here’s the code I have:
Private Sub cmdPrint_Click()
‘dim an object variable as an
‘instance of the report class object
‘named “Invoice”
Dim rpt As Report_SingleRecord
‘open an instance of the report class object
‘this isn’t visible at this point
Set rpt = New Report_SingleRecordWith rpt
‘Set the report fileter to the value
‘of the current record on this form
.Filter = “[InvID]=” & [txtInvID] & “”
‘turn the filter on
.FilterOn = True
‘make the report visible
.Visible = True
End With
‘destroy the object variable
Set rpt = NothingEnd Sub
Thanks.
Jennifer
-
WSJenniferS
AskWoody LoungerI’m trying to print off a single invoice, too. I used your code, but I keep getting: Compile Error–user-defined type not defined. What does this mean? Here’s my code:
Private Sub cmdPrint_Click()
‘dim an object variable as an
‘instance of the report class object
‘named “Invoice”
Dim rpt As Report_SingleRecord
‘open an instance of the report class object
‘this isn’t visible at this point
Set rpt = New Report_SingleRecordWith rpt
‘Set the report fileter to the value
‘of the current record on this form
.Filter = “[InvID]=” & [txtInvID] & “”
‘turn the filter on
.FilterOn = True
‘make the report visible
.Visible = True
End With
‘destroy the object variable
Set rpt = NothingEnd Sub
Also…how would you make it so you could preview it before you print it? Thanks for your help.
Jennifer
-
WSJenniferS
AskWoody LoungerOkay…I’ll explain what’s going on. I have a student form that shows the student’s name, parents, address. On that form I have a button that opens an Invoices form. On that form I have a button that opens a Payments form, and a button that opens a Withdrew form. Now…
I made a button that opens an Account form. That form I made from a query that queries all the tables together. When you look at what info the query pulls, it shows each line of the invoice with the SAME $30 payment next to it. I want the program to tell that there was only one payment and not list it on each line of the query. How do I do that? Am I missing a step?
I hope you can tell what I’m trying to explain. I don’t really have any code to show you because it is the query where I think the problem is.
Jennifer
-
WSJenniferS
AskWoody LoungerSo I would enter under criteria in the query design for InvID “=forms!frmInvoices!InvID”? Is that right? I’m a little confused.
Jennifer
-
WSJenniferS
AskWoody LoungerThanks, Brian!
-
WSJenniferS
AskWoody LoungerNow I get a syntax error in this line:
stLinkCriteria = “[InvID]=” & Forms!Invoices Subform!InvID
What did I do wrong? This is really driving me crazy!
…okay, now I don’t get the syntax error, but now it can’t find the form “Invoices_Subform”. But I DO have a form called “Invoices Subform”(I noticed that it syntaxed because I had no “_” in there). Why can’t it find my subform?
…okay. I fiddled with it some more. Now I actually got it to print my one invoice! Yeh, I’m doing the happy dance! But now, how do I get it just to print instead of preview it first?
Jennifer
-
WSJenniferS
AskWoody LoungerMark, I am having trouble printing a single invoice. I tried this “CurrentRecord”, but I don’t get any data to print out. All I get is my report with no records. And when I tried it without using CurrentRecord I get my records printed, but they ALL print. I only want the record that I’m working on to print.
I am creating an invoicing program for Student’s School Fees. I have the student on the form, and the invoice number is in a subform and the invoice detail is on another subform on the Student form. I want a “Print Invoice” button on the Student form to print out the invoice for that student, but I just can’t seem to get it to work. I made up a Query that pulls all the data that I need on my invoice in to one datasheet, but it lists all the invoices. How can I get just one? I hope you can help.
Jennifer
-
WSJenniferS
AskWoody LoungerI found something about using a “CurrentRecord” phrase in the coding, but it doesn’t really show enough info for me to really know how to use it properly. Have you used this?
Jennifer
-
WSJenniferS
AskWoody LoungerOkay, I tried this again, Rupert. I can get it to print the invoices, but now I get a box asking for a Parameter value. What is that? And it still prints out all invoices. Aaaarrrggghhh!!!
-
WSJenniferS
AskWoody LoungerI tried it and it gave me a message that it couldn’t find my “frm_Student”, so I changed it to just “Student” because that is what it is called under my forms tab. Then it gave me the same message as before that it couldn’t find InvID.
Jennifer
-
WSJenniferS
AskWoody LoungerUmmmmmm….I tried it, but it didn’t work. It said that it can’t find InvID. I have that on my form, but InvID is actually on the form in a subform. Does that make any difference?
Jennifer
-
WSJenniferS
AskWoody LoungerWhere do I enter that code you gave me? I told you I’m pretty
when it comes to VBA.
Jennifer
![]() |
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, 58 minutes ago -
CISA mutes own website, shifts routine cyber alerts to X, RSS, email
by
Nibbled To Death By Ducks
2 hours, 26 minutes ago -
Apple releases 18.5
by
Susan Bradley
2 hours, 45 minutes ago -
Fedora Linux 40 will go end of life for updates and support on 2025-05-13.
by
Alex5723
3 hours, 52 minutes ago -
How a new type of AI is helping police skirt facial recognition bans
by
Alex5723
4 hours, 30 minutes ago -
Windows 7 ISO /Windows 10 ISO
by
ECWS
11 hours, 26 minutes ago -
No HP software folders
by
fpefpe
12 hours, 11 minutes ago -
Which antivirus apps and VPNs are the most secure in 2025?
by
B. Livingston
4 hours, 23 minutes ago -
Stay connected anywhere
by
Peter Deegan
17 hours, 34 minutes ago -
Copilot, under the table
by
Will Fastie
8 hours, 47 minutes ago -
The Windows experience
by
Will Fastie
23 hours, 48 minutes ago -
A tale of two operating systems
by
Susan Bradley
14 hours, 44 minutes ago -
Microsoft : Resolving Blue Screen errors in Windows
by
Alex5723
1 day, 5 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, 33 minutes ago -
Blocking Search (on task bar) from going to web
by
HenryW
1 day, 21 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, 12 hours ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
1 day, 14 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.