Pete to big to send and every record contains confidential data, if I
stripped this out there would be no records left.
You would also need a network to run it on to demo the fault, it works
fine with one user over the network its only when other users connect it
goes slow. The whole network and every computer is set up to run at
1000mbps.
The bit I do not understand is if I do a search using the following
code:
Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
Which is Access's built in Find and Replace it goes straight to the
record. Yet the code below has worked fine for years without any
problems.
Regards Bob
How big is this file and is thier any personnal info. If not send me a
copy, remove caps from my address. Pete
Pete it doesn't make any difference to the speed its still very very
slow.
Bob
Pete
Yes I did leave out the word set. I will give it a try and let you
know how I get on.
Bob
Did you include the word set?
Pete you may be on to something there. If you do a search by using
the built in search facility it finds the record straight away yet
when you go through the code below it takes for ever.
I take it that rs is the record set?
I entered
rs.Close
rs = Nothing
but it comes up with an error Invalid use of property
can you help?
Thanks Bob
A memory leak really is a problem in the os or program where you
don't release whatever memory you grab. For instance you reopen a
database/table and don't release it before you close your code.
Especially if you keep your form or access open. By the way, this
was not a technical definition, I'm sure many have better. For
instance before you exit your search code
MyTable.Close
Set MyTable = Nothing
Replace MyTable with your recordset info.
Pete the code I use to search is in the afterupdate event
txtfindCustomer field as below we can search by CustomerID which
is the auto number field or by last name or by reg number
Private Sub txtFindCustomer_AfterUpdate()
txtFindDriverName = "" 'so when the query runs it returns all
drivers
txtFindRegNumber = "" 'but still filters
on Reg Num, we do just the
'opposite in the code for the Driver
Name
Dim db As Database
Dim rs As Recordset
Dim QD As QueryDef
Set db = CurrentDb()
Set QD = db.QueryDefs("qryIncidentDataFind")
QD.Parameters(0) = [Forms]![Incident Data
Entry]![txtFindCustomer]
QD.Parameters(1) = "" 'We could use the name of the control,
but it is
QD.Parameters(2) = ""
'set to "" anyway
Set rs = QD.OpenRecordset()
Me.Form.AllowEdits = False
If rs.RecordCount < 1 Then
msgbox "No Record Found"
Cancel = True
Else
Me.Requery
Me.Refresh
End If
txtFindCustomer.Value = ""
[Field143].SetFocus
txtFindCustomer.Visible = False
txtFindMsg.Visible = False
On Error GoTo 0
Exit Sub
And this is the code in the query
Like IIf([Forms]![Incident Data
Entry]![txtFindCustomer]="","*","*" & [Forms]![Incident Data
Entry]![txtFindCustomer] & "*")
So what is a memory leak?
Regards Bob
How are you searching? Do you use the standard built in search
and filters or some kind of customized search form using VBA?
Sounds like you may have a memory leak.
I couldn't find anything there that would help.
Bob
message
Try looking at
www.allenbrowne.com Allen has a great list
of help files,
and I think one of them is ways to speed up slow forms.
:
Hi we have come across a problem with our networked db you
can do a search 2
or 3 times and it returns the results in less than a second
after that it
takes about 15 seconds to do the same search
we only have 5 users and about 40,000 records has anyone any
idea's? If we
all close the db and then re-open it its fine for the next
2-3 searches then
it goes slow again.
We have had our IT company come and have a look at the
network but they went
await scratching there heads.
Bob