Option Compare Database
Option Explicit
Private Sub Command7_Click()
On Error GoTo Err_Command7_Click
Dim stDocName As String
stDocName = "WHPR_PRICERANGE"
DoCmd.Close acForm, "WHPR_PRICERANGE"
DoCmd.OpenForm stDocName, acNormal, acEdit
Exit_Command7_Click:
Exit Sub
Err_Command7_Click:
MsgBox Err.Description
Resume Exit_Command7_Click
End Sub