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!

form slow to open - could code be the problem

Status
Not open for further replies.

tizwaz

Technical User
Aug 8, 2002
437
GB
I am developing a database. The back end is on a network drive in another office. The front end is on a network drive locally. Some forms (with no code) open immediately. One, however, takes ages to open. Its based on a v simple query but has quite a bit of code on one of the fields after update. Could this affect the speed of opening. There is no code on the On Open or On Current events only on either command buttons on the form or one fields after update.
 
Have you tried stepping through, to see if there are any obvious delays?
 
Apart from 3 command buttons which just move to the next and previous record or close the form (for which there is no delay) there is only this code on the after update event of one field - there is also a delay when updating this field. It auto-creates an email based on the info on the form.
It may be more long-winded than it needs to be - what do you think.


Private Sub chkReport_AfterUpdate()
Dim strdate As Date
Dim stroffice As String
Dim strReportedOn As Date
Dim strHall As String
Dim strcategory As String
Dim strdetails As String
Dim strOS As String
strdate = Now()
stroffice = Me.cboOffice
strHall = Me.cboFloor_Hall
strReportedOn = Me.txtDate

strcategory = Me.cboCategory
strdetails = "Feedback received from staff on" & " " & strReportedOn & " " & "as follows" & vbCrLf & vbCrLf
strdetails = strdetails & stroffice & " " & strHall & vbCrLf & vbCrLf
strdetails = strdetails & Me.txtdetails
strdetails = strdetails & vbCrLf & vbCrLf & "Thanks" & vbCrLf
strdetails = strdetails & vbCrLf & cboOS

strOS = Me.cboOS

If Me.chkReport.Value = -1 Then
DoCmd.GoToControl "txtDateReported"
Me.txtDateReported.Value = strdate
DoCmd.SendObject , , , "john.smith@xxx.co.uk", , , "For information/" & stroffice & "/" & strcategory, strdetails, True
End If
End Sub
 
It is possible that your message is quite long. This can be a problem in Access 2000. Have you tried Outlook Automation or CDO?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top