submenu with only four rows

kabir_hussein

Registered User.
Local time
Today, 13:49
Joined
Oct 17, 2003
Messages
191
Hi i am doing a form which has a submenu in it. The submenu consist of a table and i was wondering if there is any way you can limit the list of the submenu to only four rows.

Many thanks

i have added a screen shot

kabir
 

Attachments

  • submenu.JPG
    submenu.JPG
    93.9 KB · Views: 122
in the query for your form, use

SELECT TOP 4........
 
Hi

what do you mean in the query for your form select top...4

the form i am using is used for data entry and the submenu is related to the main menu. the sub menu is a table of data and i was trying to make the table only show the first four colums and no more. I do not want users to type in more than four rows

If you know what i mean

many thanks

kabir
 
I understand what you mean now, but I do not have an answer for you.
 
Query ......

You can use Top 4 method. See below. (database is orderentry by microsoft)

MS orderenty database (qryOrdersByCustomers)
=====================================================
SELECT DISTINCTROW top 4 Orders.OrderID, Orders.CustomerID, Orders.OrderDate, Orders.FreightCharge, Orders.SalesTaxRate, Sum(CLng(nz([Quantity]*[UnitPrice]*(1-[Discount]))*100)/100) AS LineTotal, Orders.ShipDate, [Sum Of Payments Query].[Total Payments] AS [Total Payments]
FROM (Orders LEFT JOIN [Sum Of Payments Query] ON Orders.OrderID = [Sum Of Payments Query].OrderID) LEFT JOIN [Order Details] ON Orders.OrderID = [Order Details].OrderID
GROUP BY Orders.OrderID, Orders.CustomerID, Orders.OrderDate, Orders.FreightCharge, Orders.SalesTaxRate, Orders.ShipDate, [Sum Of Payments Query].[Total Payments];
=====================================================

Good Luck

Dianna Goldsberg
 
Hi

im a bit confused as to what you mean, If you look at the attachment on the first post, I am trying to do a form where users type in data into the main form and sub form and then based on the four rows on the sub form i can work out the cheapest value of an item

Hope this help, thank you for all the help so far much appreciated.

Kabir Hussein
 
Jamils_gateway said:
You can use Top 4 method. See below. (database is orderentry by microsoft)

MS orderenty database (qryOrdersByCustomers)
=====================================================
SELECT DISTINCTROW top 4 Orders.OrderID, Orders.CustomerID, Orders.OrderDate, Orders.FreightCharge, Orders.SalesTaxRate, Sum(CLng(nz([Quantity]*[UnitPrice]*(1-[Discount]))*100)/100) AS LineTotal, Orders.ShipDate, [Sum Of Payments Query].[Total Payments] AS [Total Payments]
FROM (Orders LEFT JOIN [Sum Of Payments Query] ON Orders.OrderID = [Sum Of Payments Query].OrderID) LEFT JOIN [Order Details] ON Orders.OrderID = [Order Details].OrderID
GROUP BY Orders.OrderID, Orders.CustomerID, Orders.OrderDate, Orders.FreightCharge, Orders.SalesTaxRate, Orders.ShipDate, [Sum Of Payments Query].[Total Payments];
=====================================================

Good Luck

Dianna Goldsberg


he want's to limit the number of inserts..not selects.
 
Add the following to the OnCurrent event of the Subform:

Code:
Const MaxRows = 4 
Dim nRowsToShow As Integer

nRowsToShow = Me.RecordsetClone.RecordCount

If nRowsToShow = MaxRows Then 
Me.AllowAdditions = No
Else
Me.AllowAdditions = Yes
End If
 

Users who are viewing this thread

Back
Top Bottom