DoCmd.GoToRecord , , acNewRec command is not there. The form is set as a data entry form. I have included my if statements but i dont think the problem is there. I have taken out the close commands and records are not created, i put them back in and the form closes and creates the record. How do i close the form without it creating the record.
P.S. i have also tried doCmd.close as upposed to coCmd.close acForm, "form_Company-Project" with the same record creating result.
Any help would be greatly appreciated
Cheers,
Oxford Consult
Expand|Select|Wrap|Line Numbers
- Private Sub Command22_Click()
- If Me.Combo25.Value = 0 Then
- If Me.Combo8.Value = 0 Then
- DoCmd.Close acForm, "Form_Company-Project"
- DoCmd.OpenForm "Form_Mainpage"
- Else
- MsgBox "You have only selected a company and no link will be created", vbCritical, "Note"
- DoCmd.Close
- DoCmd.OpenForm "Form_Mainpage"
- End If
- Else
- If Me.Combo8.Value = 0 Then
- MsgBox "You have only selected a project and no link will be created", vbCritical, "Note"
- DoCmd.Close acForm, "Form_Company-Project"
- DoCmd.OpenForm "Form_Mainpage"
- Else
- zmessage = MsgBox("You have slected a company and project to create a link but have not created a link." & vbCrLf _
- & "Do you wish to do so now?", vbYesNo + vbQuestion, "Link selected but not created")
- If zmessage = 6 Then
- MsgBox ""
- MsgBox "A link has been created", vbInformation, "Note"
- DoCmd.Close acForm, "Form_Company-Project"
- DoCmd.OpenForm "Form_Mainpage"
- Else
- DoCmd.Close acForm, "Form_Company-Project"
- DoCmd.OpenForm "Form_Mainpage"
- End If
- End If
- End If
- End Sub