By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,335 Members | 2,218 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,335 IT Pros & Developers. It's quick & easy.

Creating a Command that will Run a Top 20 Query

P: 19
Hi,

I have been creating a database in Access 2003, I have created a form that will show information about a company. On this I have created a Command Button that will a form of the customer details for the relevant company that is shown on the form. I have the code below which is from a wizard

Expand|Select|Wrap|Line Numbers
  1. Private Sub Disclosures_Click()
  2. On Error GoTo Err_Disclosures_Click
  3.  
  4.     Dim stDocName As String
  5.     Dim stLinkCriteria As String
  6.  
  7.     stDocName = "Customer Details"
  8.  
  9.     stLinkCriteria = "[FINANCIAL INST NAME]=" & "'" & Me![Financial Institution] & "'"
  10.     DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria
  11.  
  12. Exit_Disclosures_Click:
  13.     Exit Sub
  14.  
  15. Err_Disclosures_Click:
  16.     MsgBox Err.Description
  17.     Resume Exit_Disclosures_Click
  18.  
  19. End Sub
  20.  
What I would like to do now is create another command button that will open a datasheet view as before but just to show the top twenty customers by highest balance. The field for highest balance is simply named 'Balance'

Hopefully you can help.

Cheers
Sep 12 '08 #1
Share this Question
Share on Google+
1 Reply


P: 19
Sorry first paragraph wasnt clear

I have created a command button that will open a form in datasheet view
Sep 12 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.