Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > Help > DevNet >
Back to Access Developer Network    Comments List
Upload Images   @Reply   Bookmark    Link   Email  
What is Wrong with This Visual Basic Code
Jeff Shepard 
      
4 months ago
What is wrong with this code.  It does nothing when the button is pressed.

Private Sub AddRecordBtn_Click()
DoCmd.OpenForm "AddRecordProtectedSingleRecordF", OpenArgs:=PassID
Me.AllowAdditions = True
DoCmd.RunCommand acCmdRecordsGoToNew
Me!Description = ""
End Sub

No error code is given.  It does nothing.  I checked if the form being open is correct.   Its correct and spelled correctly.
Jeff Shepard OP  @Reply  
      
4 months ago
I took the OpenArgs:=PassID   This line was taken out.  It works.  If it works.....Don't fix it!!!
This thread is now closed.

Jeff
Kevin Robertson  @Reply  
          
4 months ago
What are you trying to do? Open the Form to a specific PassID?
   DoCmd.OpenForm "AddRecordProtectedSingleRecordF", , , "PassID=" & PassID

Are you setting AllowAdditions to True on the Form you are opening?
   Forms!AddRecordProtectedSingleRecordF.AllowAdditions = True

Not sure why you want to go to a new record when opening a specific record.
Jeff Shepard OP  @Reply  
      
4 months ago
Kevin I want to open the add form to the next available record number or PassID.  Right know that code works like a champ.  I thank you for your help.  I better leave it alone. I will add this line of code "Forms!AddRecordProtectedSingleRecordF.AllowAdditions = True"  Still works opens up with Record 118.  Which is the next record in the table.

So Kevin.  I consider this issue closed.  It works perfect.  Thank you.

You earn one one tip of $20.00.  I am still working on the "Edit Button.  

I need your help with the Administration return code generator. and the Key code generator.  Now I will post that in the Registration seminar.  So no one outside the paid registration seminar attendees see the code.  Which I generated.

Watch for my post in that seminar forum.  If you help me fix those two subroutines.  I will pay you another $20.00
On the first I will pay you.

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

 
 
 

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 2025 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/22/2025 9:40:40 PM. PLT: 0s