Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Missing Operator
David Clement 
      
12 hours ago
Good morning Richard,
I am hoping that you can advise me on this. I have created a UPS like shipping app. It works somewhat okay, but I am having an issue with the print label button. This is my code:

     DoCmd.OpenReport "Ship1", acViewPreview, , "CustomerID=" & CustomerID

It says I am missing an operator.
I would like it to work like your invoicing database.
This will probably be my last time asking for help with my job related questions as I am retiring soon.
Thank you.

David Clement OP  @Reply  
      
12 hours ago

David Clement OP  @Reply  
      
12 hours ago

David Clement OP  @Reply  
      
12 hours ago

Kevin Robertson  @Reply  
          
12 hours ago
You are sitting on a new record so there is no CustomerID.

If Not Me.NewRecord Then
    Me.Refresh
    DoCmd.OpenReport "Ship1", acViewPreview, , "CustomerID=" & CustomerID
End If
David Clement OP  @Reply  
      
12 hours ago
Thank you.
David Clement OP  @Reply  
      
12 hours ago
I am still struggling with this. I can't get it to print the current label. I know I have done something wrong, just don't know what it is. In the print dialog box, it shows the label(s) but when I click print, it prints all labels instead of the current one.
David Clement OP  @Reply  
      
12 hours ago
Is this right?

Private Sub PrintBtn_Click()

If Not Me.NewRecord Then
    Me.Refresh
    DoCmd.OpenReport "Ship1", acViewPreview, , "CustomerID=" & CustomerID
End If
End Sub
David Clement OP  @Reply  
      
11 hours ago
Now, when I click the Print Button, It shows me the first record, not the current one.
Kevin Robertson  @Reply  
          
11 hours ago
What is the Primary Key for the Form shown in your screenshot?
I don't think it is CustomerID.
Monica Jones  @Reply  
       
11 hours ago
When you say the "first record" is that first in the table or first for that customer? I would consider having a separate ID for labels, since I would expect to have multiple shipments per customer. Maybe concatenate CustomerID and OrderID, or just use OrderID?
David Clement OP  @Reply  
      
11 hours ago
My Primary Key Is ID=AutoNumber
Kevin Robertson  @Reply  
          
11 hours ago
Then replace CustomerID with ID.
David Clement OP  @Reply  
      
11 hours ago
I think I fixed it. I changed the CustomerID Field to just ID and now it works. I will try it a few more time to see if it is really fixed. Thank you all for your help.
David Clement OP  @Reply  
      
11 hours ago
Yes, it's working. Thank you to all who gave advice.
Add a Reply Upload an Image
Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/1/2026 10:35:12 PM. PLT: 1s