R
rafisch
The following code is used to open a new form - frmNewCompany to allo
the user to record a new company nam
Private Sub Company_DblClick(Cancel As Integer
DoCmd.OpenForm "FrmNewCompany", acNormal, , , acFormAdd, acDialo
DoCmd.GoToRecord , , acNewRe
End Su
If the user attempt to leave this form without entering a value in th
Company field he is prompted with a MsgBox with the option to continu
or cancel. The Continue action should close the from (frmNewCompany
however I am getting a 2585 erro
Private Sub Company_Exit(Cancel As Integer
Dim Prompt, buttons, Title, Respons
Dim intState As Intege
Dim intCurrentType As Intege
Dim strCurrentName As Strin
intCurrentType = Application.CurrentObjectTyp
strCurrentName = Application.CurrentObjectNam
Prompt = "You have not entred a valid name. Continue?
buttons =
Title = "Entering New Company
If IsNull(Me!Company) The
Response = MsgBox(Prompt, buttons, Title
If Response = 6 The
If (intCurrentType = 2 And strCurrentName = FrmNewCompany) The
DoCmd.Close intCurrentType, strCurrentName, acSaveN
End I
End I
End I
End Su
What am I doing wrong
Thank
the user to record a new company nam
Private Sub Company_DblClick(Cancel As Integer
DoCmd.OpenForm "FrmNewCompany", acNormal, , , acFormAdd, acDialo
DoCmd.GoToRecord , , acNewRe
End Su
If the user attempt to leave this form without entering a value in th
Company field he is prompted with a MsgBox with the option to continu
or cancel. The Continue action should close the from (frmNewCompany
however I am getting a 2585 erro
Private Sub Company_Exit(Cancel As Integer
Dim Prompt, buttons, Title, Respons
Dim intState As Intege
Dim intCurrentType As Intege
Dim strCurrentName As Strin
intCurrentType = Application.CurrentObjectTyp
strCurrentName = Application.CurrentObjectNam
Prompt = "You have not entred a valid name. Continue?
buttons =
Title = "Entering New Company
If IsNull(Me!Company) The
Response = MsgBox(Prompt, buttons, Title
If Response = 6 The
If (intCurrentType = 2 And strCurrentName = FrmNewCompany) The
DoCmd.Close intCurrentType, strCurrentName, acSaveN
End I
End I
End I
End Su
What am I doing wrong
Thank