S
steve2jh
i am using the following code on the save command of a form & wish the
queries only to run for the current record on the form but they seem to run
for every record in the table, this takes about five minutes on the current
4000 odd records any suggestions
Option Compare Database
'------------------------------------------------------------
' save_exit_form1
'
'------------------------------------------------------------
Function save_exit_form1()
On Error GoTo save_exit_form1_Err
DoCmd.SAVE , ""
If (Forms!editorderdetails![Our Ref]) Then
DoCmd.OpenQuery "Currency", acViewNormal, acEdit
End If
If (Forms!editorderdetails![Our Ref]) Then
DoCmd.OpenQuery "Currency1", acViewNormal, acEdit
End If
If (Forms!editorderdetails![Our Ref]) Then
DoCmd.OpenQuery "Net Calculator", acViewNormal, acEdit
End If
If (Forms!editorderdetails![Our Ref]) Then
DoCmd.OpenQuery "Net Calculator1", acViewNormal, acEdit
End If
If (Forms!editorderdetails![Our Ref]) Then
DoCmd.OpenQuery "Total Calculator", acViewNormal, acEdit
End If
If (Forms!editorderdetails![Our Ref]) Then
DoCmd.OpenQuery "Total Calculator1", acViewNormal, acEdit
End If
If (Forms!editorderdetails![Our Ref]) Then
DoCmd.OpenQuery "Vat Calculator", acViewNormal, acEdit
End If
If (Forms!editorderdetails![Our Ref]) Then
DoCmd.OpenQuery "Vat Calculator1", acViewNormal, acEdit
End If
If (Forms!editorderdetails![Our Ref]) Then
DoCmd.OpenQuery "EuroConversion", acViewNormal, acEdit
End If
If (Forms!editorderdetails![Our Ref]) Then
DoCmd.OpenQuery "Rate Card Bonus", acViewNormal, acEdit
End If
DoCmd.Close acForm, "editorderdetails"
save_exit_form1_Exit:
Exit Function
save_exit_form1_Err:
MsgBox Error$
Resume save_exit_form1_Exit
End Function
queries only to run for the current record on the form but they seem to run
for every record in the table, this takes about five minutes on the current
4000 odd records any suggestions
Option Compare Database
'------------------------------------------------------------
' save_exit_form1
'
'------------------------------------------------------------
Function save_exit_form1()
On Error GoTo save_exit_form1_Err
DoCmd.SAVE , ""
If (Forms!editorderdetails![Our Ref]) Then
DoCmd.OpenQuery "Currency", acViewNormal, acEdit
End If
If (Forms!editorderdetails![Our Ref]) Then
DoCmd.OpenQuery "Currency1", acViewNormal, acEdit
End If
If (Forms!editorderdetails![Our Ref]) Then
DoCmd.OpenQuery "Net Calculator", acViewNormal, acEdit
End If
If (Forms!editorderdetails![Our Ref]) Then
DoCmd.OpenQuery "Net Calculator1", acViewNormal, acEdit
End If
If (Forms!editorderdetails![Our Ref]) Then
DoCmd.OpenQuery "Total Calculator", acViewNormal, acEdit
End If
If (Forms!editorderdetails![Our Ref]) Then
DoCmd.OpenQuery "Total Calculator1", acViewNormal, acEdit
End If
If (Forms!editorderdetails![Our Ref]) Then
DoCmd.OpenQuery "Vat Calculator", acViewNormal, acEdit
End If
If (Forms!editorderdetails![Our Ref]) Then
DoCmd.OpenQuery "Vat Calculator1", acViewNormal, acEdit
End If
If (Forms!editorderdetails![Our Ref]) Then
DoCmd.OpenQuery "EuroConversion", acViewNormal, acEdit
End If
If (Forms!editorderdetails![Our Ref]) Then
DoCmd.OpenQuery "Rate Card Bonus", acViewNormal, acEdit
End If
DoCmd.Close acForm, "editorderdetails"
save_exit_form1_Exit:
Exit Function
save_exit_form1_Err:
MsgBox Error$
Resume save_exit_form1_Exit
End Function