Access 2007-2019
Access 2000-2003
Access Seminars
TechHelp Support
Tips & Tricks
Access Forum
Course Index
Topic Glossary
Insider Circle
Home   News   Tips   Glossary   Templates   Forums   Help   Logon   Order   Contact Us  

News      User Comments     History     Notify Me

Microsoft Access 220
By Richard Rost   Richard Rost on Facebook Richard Rost on Twitter Richard Rost on Google Plus Richard Rost on LinkedIn Email Richard Rost

Advanced Query Techniques, Part 1 of 4. Sales Log Query, Calculated Fields in Queries, Totals in Form Footers, Join Types (Inner & Outer), Cascade Deletes

Permanent Link
Course Link: Microsoft Access 220
Keywords: access join query
Post Reply

Where Condition Comment from Will @ 12/6/2012
Hi Richard,

i forget how to do a double where condition when opening a form.

docmd.openform "CustomerT", , , "ID = " & "Forms!TutorT!ID"

how do i add on another condition like first name.

Reply from Richard Rost:

Well, if you're using an ID, then you wouldn't need a second condition because that's pretty specific. However you might sometimes want:

Docmd.Openform "CustomerF",,,"FirstName=Joe AND LastName=Smith"

And of course if those are fields or variables, you'd need to say:

Docmd.Openform "CustomerF",,,"FirstName="""& FN & """ AND LastName=""" & LN & """"

Show Just This Thread        Post Reply
tables have repetitive data Comment from Roderick Barbour @ 12/2/2012
Richard, I am sure that you have answered this question somewhere along the way, but at Time Index 9:10-10:03 after you do the inner join and the left outer join all the tables have repetitive data. Why is that? Thanks in advance.

Reply from Richard Rost:

It's been several YEARS since I recorded this video... but either (a) the answer is coming, or (b) I just copied extra data for illustration purposes. If I don't answer the question soon (in the videos) let me know and I'll rewatch it.
Show Just This Thread        Post Reply
Balloon Comment from E @ 8/26/2012
No problem. Just thought I'd point it out in case you reshoot this clip.
Show Just This Thread        Post Reply
Balloon Comment from  E @ 8/24/2012
FYI: Balloon has 2 ls in it.

Reply from Richard Rost:

You are absolutely correct. Sometimes I get so into the database part of the class that I forget my simple spelling. :)
Show Just This Thread        Post Reply
Access 220 video 4 installing button Comment from Patrick H @ 6/17/2012
Thanks Richard,
Here is the code that comes up when I try and open the Customer form

Dim stLinkCriteria As String

    stDocName = "StudentF"
    stLinkCriteria = "[CustomerID]=" & Me![CustomerID]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Exit Sub

    MsgBox Err.Description
    Resume Exit_GoToStudentButton_Click
End Sub
Private Sub ShowSalesButton_Click()
On Error GoTo Err_ShowSalesButton_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "SalesLogF"
    stLinkCriteria = "[CustomerID]=" & Me![CustomerID]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Exit Sub

    MsgBox Err.Description
    Resume Exit_ShowSalesButton_Click
End Sub

Reply from Richard Rost:

OK, your button code looks fine. Where's your OnCurrent event?
Show Just This Thread        Post Reply
Comment from  Patrick Hoffmann @ 6/17/2012
Access 220 4th video "Sales Log Form" - I just installed the button on my customer form to open the sales log form and when I saved it and tried the button I got the following error message "The expression On Current you entered as the event property setting produced the following error:
Ambiguous name detected: ShowSalesButton_Click". I have no idea how to go about fixing this would so very appreciate any and all help.

Reply from Richard Rost:

Let's see all of your code. That could mean that you have TWO subs called ShowSalesButton_Click, or you don't have any and it can't find one. Check for a duplicate first.
Show Just This Thread        Post Reply
Comment from Estelita Oledan @ 5/8/2012
0:36 Im using Access 2007 I cannot see Queries on the available field list..can you help me out thanks
Show Just This Thread        Post Reply
Comment from Tiffany Parker @ 1/25/2011
At marker 03:28 you are able to click on the plus sign in CustomerT and see all of the sales transactions from SalesLogT for each customer, I'm unable to do that with Access 2007. When I select the plus sign a new window opens called 'Insert Subdatasheet'. Do you have suggestions on what I must do to obtain the sales transactions per customer?

Reply from Richard Rost:

You must have a GLOBAL RELATIONSHIP set up for this to work at the table level.
Show Just This Thread        Post Reply
Comment from Doris  Taijeron @ 9/2/2010

I have a query with a field "NoOfDaysToComplete. I want an average of number of days to complete. Can you give me tips on how to acheive this? I tried the Group funtion but I'm not getting an average.  Thanks
Show Just This Thread        Post Reply
Comment from Hassan  Ali @ 8/7/2010

Iis it possible to have a primary key which is automatically generated but set the way I want it. For e.g. A1023, A1024, A1-25 etc.

Reply from Richard Rost:

You can use VBA programming to construct your own counter, yes. See this tutorial. Once you have the number, you can add anything else you want to it, like the customer's last name, or first initial. It's up to you.
Show Just This Thread        Post Reply
Comment from Mubeezi Micah @ 5/6/2010
Dear Richard,

Looking at this video at 9:33minutes, i dont understand why you opt to use the round off function in a querry instead of the "decimal places" just below the format property in the open dialog box (field properties).

Is there a specific reason? I have to admit i did not know the round off function before. I had opportunity to learn it in this 220 video however i was curious that that there could be a reason that you perhaps did not mention.

Please let me know. Thank you!


Reply from Richard Rost:

Both work just fine. I guess my way goes back to my old Visual Basic programming days where we HAD to use the Round() function in code... we couldn't rely on the decimal property for our text boxes. I probably should have mentioned that in the video. :)
Show Just This Thread        Post Reply
Comment from Greg Paradise @ 2/25/2009
I'm glad to see you use a different color background:0  Dark grey is cool...almost black.
Show Just This Thread        Post Reply

Add Your Comments or Subscribe
If you just want to subscribe to get email updates when the News is updated, then enter your name and email address and check the Notify Me box below. If you would optionally like to add your comments below to be posted, they are welcome.
  Your Name:  Required
  Your Email:  NOT Public


Sorry about this step. It's just to keep the spam bots away:
  Verify: What is 3+7:
  Notify me when the News is updated.
  Remember Me for my next comments
Please do not use this form for Customer Service inquiries! If you have questions about your account, shipping info, courses you've ordered, need passwords, etc. please use the Customer Service Center instead.

I value your comments. They will be displayed on this page (above). Your name will be displayed, but your email address will not be.
As always, I promise to never give away your personal information to anyone else, ever.

NOTE: If you don't leave your name and email address, DON'T expect a reply. I can't promise a personal reply to everyone who posts here. I TRY my best, but I cannot guarantee it. If you don't leave your real name and email address, I won't even bother. I usually just hit DELETE. -Richard



You may want to read these articles from the 599CD News:

8/15/2019Last Chance for Access CDs
8/1/2019Customer List Form Template
8/1/2019New Template Access Customer Database
7/30/2019Microsoft Access Developer 13
6/20/2019TIP: Validation Rules in Access
11/20/2018Microsoft Access Developer 12
8/25/2018NEW: Access Dev 9, 10, 11
8/25/2018Microsoft Access Developer 11
8/25/2018Microsoft Access Developer 10
8/25/2018Microsoft Access Developer 9

Visual Basicindex
Account Login
Online Theater
Lost Password
Free Upgrades
Insider Circle
Student Databases
Change Email
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search Our Site
Waiting List
Production Schedule
Collapse Menus
Live Chat
Customer Support
WalkThru Tutorials
Consulting Services
About Us
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Video Tutorials
MYOLP Memberships
Idiot's Guide to Excel
Volume Discounts
Payment Info
Terms of Sale
Gift CDs
Live Chat
General Info
Support Policy
Contact Form
Email Us
Mailing Address
Phone Number
Fax Number
Course Survey
Facebook    Twitter

Google Plus    LinkedIn

Blog RSS Feed    YouTube Channel
Richard Rost Microsoft MVP