473,396 Members | 1,666 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Creating a Command that will Run a Top 20 Query

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
1 1191
Sorry first paragraph wasnt clear

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

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

Similar topics

3
by: Indraneel Sheorey | last post by:
Hello, I want to set up a query in SQL Server that is "grouped by" a variable PRICE. Since PRICE takes on continuous decimal values, I want to create deciles based on this variable and then...
4
by: pankaj_wolfhunter | last post by:
hi, The Query to Create View is: CREATE VIEW PROJECT_vw AS \ SELECT \ PROJNO \ ,PROJNAME \ ,DEPTNO \ ,RESPEMP \ ,PRSTAFF \ ,CHAR(SUBSTR(monthname(PRSTDATE),1,3))||'
7
by: Simon Bailey | last post by:
How do you created a query in VB? I have a button on a form that signifies a certain computer in a computer suite. On clicking on this button i would like to create a query searching for all...
1
by: Pragati | last post by:
Hi ! I have an SQL query which im developing on the click of a command button on a form. but am stuck up in creating a recordset of that query. how should one connect to database? use adodb...
1
by: longtim | last post by:
I have been having endless difficulty creating reports/queries that set any relevent parameters from controls in forms. I am creating an application under access 2003 but will target access...
3
by: Kiran | last post by:
Hi, I want to back up my data in some table in SQL server and import it back using Bulk Load of SQL server 2K. I can use the following code to backup the data in XML ...
9
by: Patrick.O.Ige | last post by:
I have a code below and its a PIE & BAR CHART. The values now are all static but I want to be able to pull the values from a database. Can you guys give me some ideas to do this? Thanks ...
6
by: ste | last post by:
Hi there, I'm just beginning to learn PHP and MySQL, but I'm finding it difficult! I wondered if someone could help me out with a problem I'm having, or at least point me in the right...
10
by: jimmy | last post by:
Hi again, sorry for posting two questions so close together but im working on a school project which is due in soon and running into some difficulties implementing the database parts. I have the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.