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

Creating a Command that will Run a Top 20 Query

P: 19

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
  4.     Dim stDocName As String
  5.     Dim stLinkCriteria As String
  7.     stDocName = "Customer Details"
  9.     stLinkCriteria = "[FINANCIAL INST NAME]=" & "'" & Me![Financial Institution] & "'"
  10.     DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria
  12. Exit_Disclosures_Click:
  13.     Exit Sub
  15. Err_Disclosures_Click:
  16.     MsgBox Err.Description
  17.     Resume Exit_Disclosures_Click
  19. End Sub
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.

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.