S
Sharkbyte
I posted previously about a performce loss when moving my development db from
an older laptop to my newer, faster laptop.
Where I am clearly able to see the problem occuring is when I am calling a
lookup form to select an Owner record. If I enter an OwnerID directly to the
main form, the code processes in less than 3 seconds. If I use the lookup
form, which copies the selected OwnerID to the main form, closes itself, and
runs the exact same code, I am seeing 7-8 second times...
I hope I am being clear, here, and have included the code for calling the
lookup form, processing the OwnerID select, and the code run from the module.
There are a couple of subforms being opened, but since all the same code is
being run, I would expect them to process the same...
Any help is greatly appreciated.
<<Code from directly entering OwnerID - main form>>
Private Sub txtOwnerID_AfterUpdate()
If IsNull(DLookup("ownerid", "qrymanageowners1")) Or DLookup("ownerid",
"qrymanageowners1") = "" Then
MsgBox "There is no Owner associated with this ID. Please re-enter."
Me.txtOwnerID = ""
Me.txtOwnerID.SetFocus
Else
pfOwners1
End If
End Sub
<<Code calling lookup form - main form>>
Private Sub cmdSearchOwner_Click()
gblOwnerSearch = "MO"
DoCmd.OpenForm "frmownersearch", , , , , acDialog
Me.txtOwnerID = gblNumber7
pfOwners1
End Sub
<<Code from lookup form>>
Private Sub OwnerAddress1_DblClick(Cancel As Integer)
gblNumber7 = Me.OwnerID
DoCmd.Close acForm, "frmownersearch"
End Sub
<<Code from module - pfOwners1>>
Function pfOwners1()
[Forms]![frmmanageowners]![cmdClose].SetFocus
[Forms]![frmmanageowners]![txtOwnerID].Enabled = False
[Forms]![frmmanageowners]![txtOwnerID].Locked = True
[Forms]![frmmanageowners]![txtOwnerNotes].Locked = False
DoCmd.Close acForm, "subfrmmanageowners"
DoCmd.OpenForm "subfrmmanageowners", , , , , acHidden
'Contract Information
Select Case gblNumber1 = IIf(IsNull(DMin("contracttypeid",
"qrymanageowners2")), 0, DMin("contracttypeid", "qrymanageowners2"))
Case 0
[Forms]![frmmanageowners]![cmbContractType] = ""
[Forms]![frmmanageowners]![txtRegHour] = ""
[Forms]![frmmanageowners]![txtOvtHour] = ""
[Forms]![frmmanageowners]![txtFirstHour] = ""
[Forms]![frmmanageowners]![txtPerMile] = ""
[Forms]![frmmanageowners]![txtTravelHour] = ""
Case Else
[Forms]![frmmanageowners]![cmbContractType].Requery
[Forms]![frmmanageowners]![cmbContractType] = gblNumber1
DoCmd.Close acForm, "subfrmManageowners4"
DoCmd.OpenForm "subfrmmanageowners4", , , , , acHidden
End Select
[Forms]![frmmanageowners]![subfrmManageOwners1].Requery
[Forms]![frmmanageowners]![subfrmManageOwners2].Requery
End Function
an older laptop to my newer, faster laptop.
Where I am clearly able to see the problem occuring is when I am calling a
lookup form to select an Owner record. If I enter an OwnerID directly to the
main form, the code processes in less than 3 seconds. If I use the lookup
form, which copies the selected OwnerID to the main form, closes itself, and
runs the exact same code, I am seeing 7-8 second times...
I hope I am being clear, here, and have included the code for calling the
lookup form, processing the OwnerID select, and the code run from the module.
There are a couple of subforms being opened, but since all the same code is
being run, I would expect them to process the same...
Any help is greatly appreciated.
<<Code from directly entering OwnerID - main form>>
Private Sub txtOwnerID_AfterUpdate()
If IsNull(DLookup("ownerid", "qrymanageowners1")) Or DLookup("ownerid",
"qrymanageowners1") = "" Then
MsgBox "There is no Owner associated with this ID. Please re-enter."
Me.txtOwnerID = ""
Me.txtOwnerID.SetFocus
Else
pfOwners1
End If
End Sub
<<Code calling lookup form - main form>>
Private Sub cmdSearchOwner_Click()
gblOwnerSearch = "MO"
DoCmd.OpenForm "frmownersearch", , , , , acDialog
Me.txtOwnerID = gblNumber7
pfOwners1
End Sub
<<Code from lookup form>>
Private Sub OwnerAddress1_DblClick(Cancel As Integer)
gblNumber7 = Me.OwnerID
DoCmd.Close acForm, "frmownersearch"
End Sub
<<Code from module - pfOwners1>>
Function pfOwners1()
[Forms]![frmmanageowners]![cmdClose].SetFocus
[Forms]![frmmanageowners]![txtOwnerID].Enabled = False
[Forms]![frmmanageowners]![txtOwnerID].Locked = True
[Forms]![frmmanageowners]![txtOwnerNotes].Locked = False
DoCmd.Close acForm, "subfrmmanageowners"
DoCmd.OpenForm "subfrmmanageowners", , , , , acHidden
'Contract Information
Select Case gblNumber1 = IIf(IsNull(DMin("contracttypeid",
"qrymanageowners2")), 0, DMin("contracttypeid", "qrymanageowners2"))
Case 0
[Forms]![frmmanageowners]![cmbContractType] = ""
[Forms]![frmmanageowners]![txtRegHour] = ""
[Forms]![frmmanageowners]![txtOvtHour] = ""
[Forms]![frmmanageowners]![txtFirstHour] = ""
[Forms]![frmmanageowners]![txtPerMile] = ""
[Forms]![frmmanageowners]![txtTravelHour] = ""
Case Else
[Forms]![frmmanageowners]![cmbContractType].Requery
[Forms]![frmmanageowners]![cmbContractType] = gblNumber1
DoCmd.Close acForm, "subfrmManageowners4"
DoCmd.OpenForm "subfrmmanageowners4", , , , , acHidden
End Select
[Forms]![frmmanageowners]![subfrmManageOwners1].Requery
[Forms]![frmmanageowners]![subfrmManageOwners2].Requery
End Function