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 
Open form for more data
Daniel Palo 
    
3 years ago
I am having issues getting a form to open from a "customer" form. I need the new form to open with the customer ID and set up to add date or modify info. I used the "Open Form" from a command button to display Specific Data where "ID = ID". The form opens but the ID is "0" and therefore I can not get the data to be tied to the customer. I know I'm missing something but I just can't figure out what.
Daniel Palo OP  @Reply  
    
3 years ago
That is supposed to read "set up to add data or modify info." Sorry about that.
John Davy  @Reply  
         
3 years ago
try ID=" & ID
John Davy  @Reply  
         
3 years ago
Try "ID = " & ID
Scott Axton  @Reply  
        
3 years ago
Daniel you need to set the default value on the form you are opening to the ID of the form you are opening it from.
     = Forms!FormName!FieldName

So it would be something like =Forms!CustomerF!CustomerID

See Value From a Form if you need a refresher.
Daniel Palo OP  @Reply  
    
3 years ago
This is what I have that isn't working:

Private Sub cmdCummunityDischargeLetterTracking_Click()

    If IsNull(patientID) Then Exit Sub
    DoCmd.OpenForm "frmDischargeLetter", , , "PatientID=" & patientID
    
End Sub
Scott Axton  @Reply  
        
3 years ago
See my previous response.  

In the "frmDischargeLetter" click on the PatientID field and then go to the properties. Find Default Value.
You are taking the value of PatientID from the form that the cmdCummunityDischargeLetterTracking button is on.

Something I'm seeing as well - Check your spelling.  Is it really Cummunity or should it be Community?
Daniel Palo OP  @Reply  
    
3 years ago
I appreciate you noticing the spelling error. I didn't catch that. However, that is what I named the button so the cmdCummunity" spelling was automatic when building the event. I have fixed this portion now though and will avoid any further embarrassment. Thanks.

So, after fixing the default value to read Forms!frmDischargeLetter!PatientID I get an #ERROR in the patient ID field when the form opens up.
Kevin Robertson  @Reply  
          
3 years ago
The Default Value should come from the form you have come from not the form you are opening.

Please can you post some screenshots so we can see what you are working with.
Daniel Palo OP  @Reply  
    
3 years ago

Daniel Palo OP  @Reply  
    
3 years ago

Daniel Palo OP  @Reply  
    
3 years ago
You can see the Button I'm clicking to bring up the Discharge Letter Tracking Form (blue form). I'm hoping to add data to this form and and keep visible when ever this form is open. This data is all kept in one table and the tables are related by PatientID
Scott Axton  @Reply  
        
3 years ago
Daniel what is the name of the form (Patient Worksheet) that the button is on?

The default value goes in the ID field of the frmDischargeLetter.
Daniel Palo OP  @Reply  
    
3 years ago
Scott, the name of the form is frmPtWorksheet
Kevin Robertson  @Reply  
          
3 years ago
For the Default Value on the PatientID on the frmDischargeLetter Form:

=Forms!frmPtWorksheet!PatientID
Daniel Palo OP  @Reply  
    
3 years ago
That seems to have done the trick for getting the patient ID and data to come over. It's weird because I didn't have this problem with any of the other forms that I created and used as subforms in the Patient Worksheet. Now I can't get it to let me add data to the Discharge Letter form or edit data. I have it set to Data Entry = Yes. I just don't know why I'm struggling so much with this one form and its data.

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: 5/7/2026 5:03:22 AM. PLT: 0s