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 
New Work Order Foe Current Device
Tannim Hallman 
     
12 months ago
I have a WODetailF that pulls certain info from my DeviceT using DeviceID. It works great when I click the Work Order button on DeviceF. My problem arises when a client brings a device back in and I need to make a new work order. My new work order button on the WODetailF (there is no main WorkOrderF) simply makes a new, blank record, without the device info. How do I make it so, when I click NewWOBtn, it populates with the DeviceID and associated info? Can be macro or VBA. I've dabbled in both.
Tannim Hallman OP  @Reply  
     
12 months ago
BTW, I tried Private Sub NewWOBtn_Click()

    DoCmd.OpenForm "WODetailF", , , , acFormAdd, acDialog, Me.DeviceID

    
End Sub

and now it does nothing.
Kevin Robertson  @Reply  
          
12 months ago
If the field is available on the current Form you can set a Default Value
If the field is NOT available on the current Form you can use DLookup

I neither fit your needs, please post some screenshots.
Donald Blackwell  @Reply  
       
12 months ago
Since your WODetailF is being opened as a Dialog, all other scripts stop until that form closes, so you'd have to handle setting your fields in that form.

Possibly something as simple as in the "OnOpen" event setting the defaults with the DLookup as Kevin pointed out or using a recordset to get the data.

You've sent the DeviceID as an OpenArg, so somewhere in that form, you'll need to set DeviceID = OpenArgs. Sending the OpenArgs value itself doesn't do anything unless you have script on that form to read and process it. The Custom MsgBox series explains how OpenArgs work.
Tannim Hallman OP  @Reply  
     
12 months ago

Tannim Hallman OP  @Reply  
     
12 months ago
When I click the Work Order button on DeviceF, everything with blue lines populates, all defaulting from the device id through wodetailq. If I click the New Work Order button on this form, it wants to make a new, blank record for a non-existent device. It doesn't even pull the DeviceID
Tannim Hallman OP  @Reply  
     
12 months ago
Well, that explains why that code broke everything and it won't even open the form now. Something I found on StackExchange
Tannim Hallman OP  @Reply  
     
12 months ago
OK, I got it back to where the New Work Order button will open the blank form again, but it's pulling for a new device, and is also uneditable. The underlying query should be pulling this info in for the open device.
Tannim Hallman OP  @Reply  
     
12 months ago

Tannim Hallman OP  @Reply  
     
12 months ago
Private Sub NewWOBtn_Click()
    
    DoCmd.OpenForm "WODetailF", , , WODetailID = " & WODetailID"
    
End Sub
Donald Blackwell  @Reply  
       
12 months ago
Try:

DoCmd.OpenForm "WODetailF",,,"WODetailID=" & WODetailID

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

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: 6/21/2026 11:18:16 AM. PLT: 1s