Computer Learning Zone CLZ Access Excel Word Windows

Gimme' Some Sugar, Baby.

-Ash Williams
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > Courses > Access > Templates > ABCD > Part 4 < Part 3 | Part 5 >
Back to ABCD Core Part 4    Comments List
ABCD4 Detail Question Upload Images   Link   Email  
Alexis Cao 
3 years ago
Hello, i have a big question about the ABCD 4 Parts

how should i do if i need to understant the below VBA Code which comes from the ABCD 4 filter part. it's too difficult for me to understand even if i copy and see these code again and again:


Private Sub RequeryForm()

    Dim WhereStr As String
    Dim SQLStr
    
    EntityCodeFilter.BackColor = RGB(200, 200, 200) ' lt gray
    FirstNameFilter.BackColor = RGB(200, 200, 200) ' lt gray
    LastNameFilter.BackColor = RGB(200, 200, 200) ' lt gray
    OrganizationNameFilter.BackColor = RGB(200, 200, 200) ' lt gray
    
    WhereStr = ""

    If Not IsNull(EntityCodeFilter) Then
        EntityCodeFilter.BackColor = RGB(200, 255, 200) ' green
        If WhereStr <> "" Then
        WhereStr = WhereStr & " AND "
        WhereStr = WhereStr & " EntityCode LIKE ""*" & EntityCodeFilter & "*"" "
    End If

    If Not IsNull(FirstNameFilter) Then
        FirstNameFilter.BackColor = RGB(200, 255, 200) ' green
        If WhereStr <> "" Then WhereStr = WhereStr & " AND "
        WhereStr = WhereStr & " FirstName LIKE ""*" & FirstNameFilter & "*"" "
    End If

    If Not IsNull(LastNameFilter) Then
        LastNameFilter.BackColor = RGB(200, 255, 200) ' green
        If WhereStr <> "" Then WhereStr = WhereStr & " AND "
        WhereStr = WhereStr & " LastName LIKE ""*" & LastNameFilter & "*"" "
    End If
    If Not IsNull(OrganizationNameFilter) Then
        OrganizationNameFilter.BackColor = RGB(200, 255, 200) ' green
        If WhereStr <> "" Then WhereStr = WhereStr & " AND "
        WhereStr = WhereStr & " OrganizationName LIKE ""*" & OrganizationNameFilter & "*"" "
    End If
    
    SQLStr = "SELECT EntityID, EntityCode, FirstName, LastName, OrganizationName FROM EntityT"
    
    If WhereStr <> "" Then
        FilterClearBtn.Visible = True
        WhereStr = " WHERE " & WhereStr
        SQLStr = SQLStr & WhereStr
    End If
    
    If OrderByStr <> "" Then
        SQLStr = SQLStr & " ORDER BY " & OrderByStr
    End If

    EntityList.RowSource = SQLStr


or What lessons should i learn if i get to understand
Alexis Cao 
3 years ago
very confused about:

If Not IsNull(FirstNameFilter) Then
        If WhereStr <> "" Then WhereStr = WhereStr & " AND "
        WhereStr = WhereStr & " FirstName LIKE ""*" & FirstNameFilter & "*"" "
    End If

this sub has 4 wherestr, it hit my core brain directly, i lose myself: where am i , what happend. i know its effect is to filter with some conditions, but i really can't understand why these code can do these. who can help me to explain? thank you very much
Kevin Robertson           
3 years ago
This sub is saying:

   - check to see if there is anything in the FirstNameFilter
   - if it is not empty, check to see if there is anything in WhereStr, if there is add " And " to the end of it
   - then you are setting WhereStr to whatever is already in the WhereStr AND setting FirstName to whatever the value of FirstNameFilter is
   - if WhereStr is empty then FirstName will only be set equal to the value of FirstNameFilter without the AND.
Scott Axton           
3 years ago
Alexis
I understand completely the brain overload!  Believe me we've all been there at one point in time or another.  
You probably have a better understanding, since your mother language is Chinese, and yet you have learned English to communicate.

You are now learning another couple of languages.  VBA and SQL at the same time.

Here are some courses for you that I consider a MUST if you are going to continue to develop databases:

SQL  Part 1 and Part 2 most important.  (Part 3 -  not so much - as that deals with manipulating tables and such.)

The Search Seminar shows the "how to build the SQL" demonstrated in the code above. (Not this specific example but similar using the WhereStr)

All of the Developer Courses. Those teach much of the concepts shown in ABCD.
Richard has stated, multiple times in the ABCD, this is demonstration of what he did, it isn't a Teaching Course.
Scott Axton           
3 years ago
Finally
Please don't post large amounts of the code from the courses.  Richard works hard on these classes and it takes away from him.  It is also not fair to the people that paid for the classes to have the information posted where the public can see it.
Alexis Cao 
3 years ago
Dear Kevin, thank  you for your explain. i watched your answers again and again. even if i don't understand completely, but it's more easier for me to understand than Dear Richard orginal codes. i have copied your explain to my note, i checked it when i am free till to understand it completly

And Dear Scott, thank you, thank you for you still remember me who come from China. firstly, i apolpgize for to post the lesson code to the forum, i understand after you said, trust me, i will never do the similar things again. Secondly, thank you for your suggesting of lessons, that is really i want, but in fact, the lessons i need to learn is so more after you suggest. haha. but i agree with that it is the easier way to get understanding. i like Dear Richard access lesson very much, in fact, i plan to learn all if i mean if i have enough money, haha. and thank you for your understanding to tell me you have been overload before, it really gives me the consolation and convidence.
Alexis Cao 
3 years ago
at last, thank you, thank you for everyone in our website forum who helped me. i found this forum is very high efficiency and professional, even if i only post few questions, but i felt it. in fact i love it. it gives me the way to slove the confusion about access. i never think i can solve my access problem such quick and porfessional, i feel happy and give more convidence to learn more access. in fact i use the access every day now, you can think how it is important for me. thank you, thank you everyone. God bless all of you
Scott Axton           
3 years ago
Alex -
I understand the money and budgeting all to well.  Much of what is in those seminars is also covered in the TechHelp and also the regular courses.  There are lots of topics to keep you busy for a very long time.

Richard sent you an email when you became a Learning Connection Student.  In it was a special "discount link" for any of the courses you wish to take advantage of.  The LC discount is 50% the last time I checked so be sure, if you get those seminars, to use that link to take advantage of the reduced price.
Alexis Cao 
3 years ago
Dear Scott,

yes, i know the discount price. and now i am a golden member, and i also purchased the developer 28 and 29 lesson, also the ABCD in the recent with 50% discount. thank you for your kindly reminder.

Best wihses
Alex
Alexis Cao 
3 years ago
Dear Scott, how long time can be a good access user since 0, do you think. till now, i have known the access for about 5 or 6 months, but i found i need to learn more and more if i use the access smoothly. what time do you learn the access
Scott Axton           
3 years ago
Wow that is a question that doesn't really have a finite answer.  Each person learns at a different pace.
For some it comes naturally for others it's more difficult.  
For me I'm still learning every day.  I have been using Access almost since the start.  I started getting lessons almost 6 years ago but really only became serious maybe 2 years ago with Access. I did other computer languages before that.

It sounds strange but I learned the most by my failures.  LOL I learn what not to first, before I have those moments of clarity that get saved into my tool box of knowledge.
Alexis Cao 
3 years ago
yesterday i collected one saying from our website: We learn more by looking for the answers to a question and not finding it than we do from learning the answer itselft. -----Lloyd Alexander

haha, this saying meaning is like what you told me. but you learnt more than 6 years. wow!!! 666, i can't imagine what i become if i have 6 year experiences of access, you must be very professional

i keep learning everyday since 5-6 months ago. i discover the new world after knowing the access powerful founction, in fact it's Richard, let me interest in the access, in China, these is less professional teaching lesson like richard teaching video, maybe i didn't find before, but i like the teaching style of Richard.

So everyday i go into this website to learn and discover the thing i like. at last, i wish all the best for you, Dear Scott, hope to make the friendship of access learner though this website
James Gray       
2 years ago
Not sure but I think there is a minor glitch in the label sort code.  Didn't seem to work quite right until I included the Not Is Null code in the first If statement.  Once I did that it seems to work fine.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in ABCD Core Part 4.
 

 
 
 

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: 9/13/2024 2:18:25 PM. PLT: 1s