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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using text box to monitor search progress

Status
Not open for further replies.

mondeoman

MIS
Dec 7, 2006
203
GB
I used to be able to set up a text box that allowed the user to view each file or record as a loop search was called. I suppose a bit like when using a registry cleaner it shows each entry as it searches and checks. Can anyone point me to a tutorial that shows this or can advise how I can do it. For example If in my database the user decides to search a table for the sake of argument say its called tbl_Interim_Certificate and I want to show users in a text box the "job_reference" numbers as they looped through the table how do I do this please?

 
In the loop set the textbox = to the fieldname, and do a .refresh on the form for each iteration.

Beir bua agus beannacht!
 
Dear genomon
Thanks for that but what is this procedure I am asking for called and are there any examples I can look at please.
 
what is this procedure I am asking for called

It is called whatever you like. Add the code to populate the text box and refresh the form in your "view each file or record as a loop search" code. I imagine there is a file system object or recordset opened that accomplishes this. If you post back the relevant code, enhancing it should be fairly simple. Show us what you have coded so far.

Beir bua agus beannacht!
 
Thanks. I have managed to pick up some code and I have modified as this:

Public Function fShowJobReference(lngJob_Reference As Long) As String
On Error GoTo Err_fShowJobReference
'This function shows Job References in a string format

Dim dbs As DAO.Database
Dim snp As DAO.Recordset
Set dbs = CurrentDb
Set snp = dbs.OpenRecordset("tbl_Interim_Cert", dbOpenSnapshot)
snp.MoveFirst

Do Until snp.EOF
If snp![Job_Reference] = lngJob_Reference Then
fShowJobReference = fShowJobReference & IIf(fShowJobReference = "", "", "; ") & snp!Job_Reference
End If
snp.MoveNext
Loop

snp.Close
dbs.Close

Exit_fShowJobReference:
Exit Function
Err_fShowJobReference:
MsgBox Err.Description, vbCritical, "Error " & Err.Number
Resume Exit_fShowJobReference
End Function

My text box is called "txtShowJobReference". How do I integrate this into the code so that on the click of a cmd button called "cmdShowJR" I call the procedure and it shows the Job Reference in the text box.
 
You realize that the display will be on the screen for a nanosecond at best? What are you trying to accomplish exactly? Sorry I'm so in the dark here...

Beir bua agus beannacht!
 
Yes I understand why you should be perplexed. Actually I suppose in reality it is just something I want to learn how to do for databases that have large amounts of data and it allows users to see the progress being made in say updating a field or table, dleting records and so on. The above code may not be what I want. I want a method of displaying progress on an activity that expands on a simple progress bar.
 
The label or text box can display whatever you tell it to; I would probably add that code with a refresh right after the function value is set.
The point is that no human being can assimilate information that is only on the screen for less than an eyeblink, so why bother?
Maybe what you are after would be better handled by the SysCmd object. Check it and its examples out in Access help.

Beir bua agus beannacht!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top