Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Specific number of line

Status
Not open for further replies.

Aleathiel

Technical User
May 13, 2005
21
CA
I need to have a specific number of line, because I have a query that take up the pick ticket number and there is always 10 or less. The specific number of line is for having 10 box containing all the pick ticket number, so if there is 6 pick ticket, I still want 10 box or line. Is there a way to always have the 10 box shjowing up? I can't get through this one, any help will be really appreciated.

Thanks
 
Hi
Perhaps if you create a small table with 10 numbers, and link your main table to it.
 
If I do that, I will just get 10 copy of all my pick ticket, I dont want that, only want blank cell, so that the total with the pick ticket I already got is 10 cell.
 
I cannot think how to do this with a query. Here is some code that should work:
Code:
Sub MustBe10()
'Needs Microsoft DAO 3.x Object Library
Dim rs10 As DAO.Recordset
Dim rsTicket As DAO.Recordset
Dim strSQL

strSQL = "Update Numbering Set TicketNo=0"
CurrentDb.Execute strSQL

Set rs10 = CurrentDb.OpenRecordset("Numbering")

'This could contain the Select statement for picking Tickets
Set rsTicket = CurrentDb.OpenRecordset("Tickets")
Do While Not rsTicket.EOF
    rs10.Edit
    rs10!TicketNo = rsTicket!IDNo
    rs10.Update
    rs10.MoveNext
    rsTicket.MoveNext
Loop
rs10.Close
rsTicket.Close
Set rs10 = Nothing
Set rsTicket = Nothing
End Sub

It may be worth posting in:
Microsoft: Access Queries and JET SQL Forum
forum701



 
set focus to first textbox
set search to first record found
counter = 0

for loop = 1 to 10 'do it 10 times
increment the counter
set focus to textbox number same as counter
search for next ticket record
check for end of file. if at end exit the loop and go to fillintheblanks.
otherwise
textbox = record found
next loop
exitthesub:
end sub

fillintheblanks:
for loop = counter to 10
textbox = ""
set focus to textbox number same as loop
next loop
goto exitthesub





Ian Mayor (UK)
Program Error
Programmers do it one finger at a time!
 
Something to think about....

If a query is created to produce only the top ten results of something and there are say only 5 results. Does the query fill in the results to make it up to 10, and if so, what with, or does it only show the five results???

Ian Mayor (UK)
Program Error
Programmers do it one finger at a time!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top