Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Fitness 9    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Why is Access Refusing Description
Normand Caron 
      
9 months ago
Private Sub DeleteBtn_Click()
    If IsNull(FoodId) Then Exit Sub
  
    If Not AreYouSure("Delete " & Description & "?", "Delete") Then Exit Sub
    Me.Dirty = False
    CurrentDb.Execute "Delete from FoodT Where FoodID=" & FoodId
    If IsLoaded("FoodListF") Then Forms!FoodListF.Recordset.Requery
    DoCmd.Close acForm, Me.Name, acSaveYe
Normand Caron OP  @Reply  
      
9 months ago

Sami Shamma  @Reply  
             
9 months ago
Show the code that you have for the function: AreYouSure
Kevin Robertson  @Reply  
          
9 months ago
There is an argument between the Prompt and the caption.

Examples:
If Not AreYouSure("Delete " & Description & "?", , "Delete") Then Exit Sub

or

If Not AreYouSure("Delete " & Description & "?", vbOKOnly, "Delete") Then Exit Sub
Kevin Robertson  @Reply  
          
9 months ago
I stand corrected. Just noticed you are using the AreYouSure() function.
Richard Rost  @Reply  
          
9 months ago
Make sure Description has a value. If it's NULL it will throw an error. You'll need:

AreYouSure("Delete " & Nz(Description,"") ...

I'll address this in the next video.
Richard Rost  @Reply  
          
9 months ago
But then again, on second thought, description should never be null. We should probably make sure that it's required.
Normand Caron OP  @Reply  
      
9 months ago
Now it's rejecting "AreYouSure"  with the same compile error?
Richard Rost  @Reply  
          
9 months ago
Do you have the AreYouSure function in a public module?
Normand Caron OP  @Reply  
      
9 months ago
YES I DO AS FOLLOWS.
Public Function AreYouSure() As Boolean
    If MsgBox("AreYouSure?", vbYesNoCancel + vbQuestion + vbDefaultButton2, "Confirm") = vbYes Then
        AreYouSure = True
    Else
        AreYouSure = False
   End If
End Function
Matt Hall  @Reply  
          
9 months ago
I don't see any parameters to pass the description into.  You might checkout the Create Function video.
Donald Blackwell  @Reply  
       
9 months ago
Hi Normand,

Your "Are You Sure" function doesn't accept any parameters as it is written. It is just the vanilla version. Before Richard added the "Prompt" and "Title" optional parameters.

That's why it is giving you invalid # of arguments.

If you review the link to the Are You Sure? TechHelp Video Richard gave above, you'll see that at around 7 minutes, he added those two optional parameters.

I think that will resolve this error.
Normand Caron OP  @Reply  
      
9 months ago
Thank you all for the replies. The last reply from Donald fix the problem..
Donald Blackwell  @Reply  
       
9 months ago
Happens to me too. Swe something great in one of the videos and put it in a project but miss the end.

Guess that's why "patience is a virtue", lol.

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

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 8:30:58 PM. PLT: 1s