Access 2003 runs slow after 2-3 searches

B

Bob

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
 
P

Pete D.

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.
 
B

Bob

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
 
P

Pete D.

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.

Bob said:
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

Pete D. said:
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.
 
B

bob

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

Pete D. said:
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.

Bob said:
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

Pete D. said:
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
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
 
P

Pete D.

Did you include the word set?
bob said:
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

Pete D. said:
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.

Bob said:
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
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
 
B

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

Pete D. said:
Did you include the word set?
bob said:
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

Pete D. said:
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
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
 
B

bob

Pete it doesn't make any difference to the speed its still very very slow.
Bob
bob said:
Pete
Yes I did leave out the word set. I will give it a try and let you know
how I get on.
Bob

Pete D. said:
Did you include the word set?
bob said:
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
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
 
P

Pete D.

How big is this file and is thier any personnal info. If not send me a
copy, remove caps from my address. Pete
bob said:
Pete it doesn't make any difference to the speed its still very very slow.
Bob
bob said:
Pete
Yes I did leave out the word set. I will give it a try and let you know
how I get on.
Bob

Pete D. said:
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
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
 
B

bob

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


Pete D. said:
How big is this file and is thier any personnal info. If not send me a
copy, remove caps from my address. Pete
bob said:
Pete it doesn't make any difference to the speed its still very very
slow.
Bob
bob said:
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
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
 
P

Pete D.

Set db = Nothing
Set QD = Nothing

bob said:
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


Pete D. said:
How big is this file and is thier any personnal info. If not send me a
copy, remove caps from my address. Pete
bob said:
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
 
P

Pete D.

You just triggered a thought, is name autocorrect turned off for the
database in options. I know of one case that this slowed the datafile way
down after moving to 2007 as default in 2007 is on. Then go to Allen Browns
site and review all the performance pages.
http://www.allenbrowne.com/

Pete D. said:
Set db = Nothing
Set QD = Nothing

bob said:
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


Pete D. said:
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
 
B

bob

Pete auto correct is turn off. I have also been to Allen Browns web site
but can not find any help there.

Someone must have come across this problem before its driving us round the
bend its that slow 15 seconds to do a search, yet close the db then re open
it and it takes 1 second or less to do a search, do 3-5 searches and it then
goes back to 15 seconds per search.

I just don't know where to go for help next.

Bob

Pete D. said:
You just triggered a thought, is name autocorrect turned off for the
database in options. I know of one case that this slowed the datafile way
down after moving to 2007 as default in 2007 is on. Then go to Allen
Browns site and review all the performance pages.
http://www.allenbrowne.com/

Pete D. said:
Set db = Nothing
Set QD = Nothing

bob said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top