104 minutes ago: OK, I think I got the pesky Javascript error fixed. If you still see any popup error messages let me know. Thanks.  Dismiss
 
Computer Learning Zone CLZ Access Excel Word Windows

Think of the rivers of blood spilled by all those generals and emperors so that in glory and in triumph they could become the "Momentary" masters of a "Fraction" of a "Dot."

-Carl Sagan
 
Home   Courses   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Back to Access Open Other Programs Seminar    Comments List
Coding Error Upload Images   Link   Email  
Carol Herriot 
3 years ago
I am attempting to reproduce the Open Programs Database while watching the video.

The first line of the coding is highlighted in yellow so I am assuming that needs attention???  I have been staring at the coding for about 30 minutes and cant figure out what is wrong!! Maybe I can't see for looking.

Private Sub Attachment_DblClick(Cancel As Integer)

    If Right(Attachment, 4) = ".TXT" Then
        Shell "NOTEPAD.EXE " & Attachment, vbNormalFocus
    ElseIf Right(Attachment, 5) = ".XLSX" Then
        Shell "EXCEL.EXE " & Attachment, vbNormalFocus
    ElseIf Right(Attachment, 5) = ".DOCX" Then
        Shell "WINWORD.EXE " & Attachment, vbNormalFocus
    End If

End Sub

My apologies for asking yet another question . . . I really want to learn this.
Adam Schwanz
3 years ago
If Right(Attachment, 4) = ".TXT" Then
        Shell "NOTEPAD.EXE """ & Attachment & """", vbNormalFocus
Adam Schwanz
3 years ago
That's how I make mine, this could also be helpful to you Double Double Quotes
Carol Herriot
3 years ago
Thank you Adam.  I am trying to reproduce Ricks work EXACTLY.  So to that end I need to know WHY mine doesnt work AND why I got the yellow highlighted error message.  What is the message telling me is wrong?   I need to fix it  before it allows me to continue.
Scott Axton
3 years ago
Carol -

FYI - 99.9% of the time Richard provides a completed database that you can look at to learn by.
It's good that you are watching and building because it helps anchor it into the brain.

The database is useful to see where you made errors.  Sometimes you just can't see the forest for the trees.

The database can be found here:  Student Databases
I don't recall if it is password protected but if it is it is the same as for your course videos.
Scott Axton
3 years ago
Access, by highlighting the line, is telling you "this is the line that has the problem". (Most of the time)

What is the error you are getting in the message box?  That will give you an indication of what is wrong on that yellow line.
For instance a syntax error means you don't have something typed correctly.  You might be missing a parentheses or quote or comma.

The text in the error matters when you are asking for help.  It helps us to guide you.
Carol Herriot
3 years ago
*****I have been stuck at this point for days and really want to learn what I am doing wrong.*****  Can someone please help???

@Adam
I used double quotes as suggested (see cut/paste below) and I still get an error (yellow highlighted text =  Shell "NOTEPAD.EXE """ & Attachment & """, vbNormalFocus"
__________________________________________
Private Sub Attachment_DblClick(Cancel As Integer)

If Right(Attachment, 4) = ".TXT" Then
    Shell "NOTEPAD.EXE """ & Attachment & """, vbNormalFocus
End If

End Sub
____________________________________________________

Access added a quote at the end of vbNormalFocus, (see below) but does not allow me to save.  If I remove the last quote, Access puts it back.

Shell "NOTEPAD.EXE """ & Attachment & """, vbNormalFocus"

@Scott:  Thank you for the link to Rick's database.  I have downloaded it and tried to determine what I am doing wrong.  Unfortunately I am still stuck.  

Kevin Robertson
3 years ago
Carol,

You are missing a double quote.

Shell "NOTEPAD.EXE """ & Attachment & """", vbNormalFocus
Scott Axton
3 years ago
Carol -
Here is a trick I use when trying to look at code.  The old eyes aren't as good as the once were.

Copy and paste the code into Notepad and zoom it in.

In this case I assume Rick's code is good and mine is not.
Paste your code on the next line and look for the difference.  It is a lot of times easier to see in larger type of something that is fixed width font.  

For instance trying to see the difference between " and ''.  The first is a double quote ( " ).
The second is two single quotes ( ' ' - space in between for clarity )
Scott Axton
3 years ago

Scott Axton
3 years ago
Now to understanding why.  Access is trying to help you out by putting in the extra quote at the end of vbNormalFocus.  It gets it correct most of the time but not always, as is demonstrated here.

This is something you just have to learn by doing over time.  The Double Double Quotes in syntax is probably one of the most difficult things to grasp.  Watch that video again and again until it clicks.

My opinion here so take this with a grain of salt:
You are also jumping in to the deep end it appears.  I see that you have started the Beginner Series but you obviously have the Open Other Programs Seminar which contains some more advanced topics.
You need to keep learning how to crawl before you can run.  Make sure you are building your knowledge base by going through the courses.  Don't get ahead of yourself.

BTW - I get it.  Sometimes you need to get something done and NEED to go a little out of your comfort zone.
Carol Herriot
3 years ago
@Scott and Alex

Thank you for your patience.  I have solved my issue.
I started over (yet again) and it seems to be working for me now.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Open Other Programs Seminar.
 

 
 
 

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 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 2/22/2024 7:53:10 PM. PLT: 1s