With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.
Private Sub cmdSaveNew_Click() On Error GoTo Err_cmdSaveNew_Click newRec = Me.NewRecord If newRec = False Then DoCmd.RunCommand acCmdSaveRecord DoCmd.GoToRecord , "", acNewRec DoCmd.RunCommand acCmdRefresh ElseIf IsNull(Me.txtFirstName.Value) Then MsgBox ("You have not entered a first name!") ElseIf IsNull(Me.txtEmailAddress.Value) Then MsgBox ("An e-mail address is required") Else DoCmd.RunCommand acCmdSaveRecord DoCmd.RunCommand acCmdRefresh Dim rs6 As DAO.Recordset Dim curDb As DAO.Database Set curDb = CurrentDb Set rs6 = curDb.OpenRecordset("CustomerContactsMain") 'setting rs to reference the CustomerContactsMain table rs6.AddNew rs6!company_ID.Value = txtIDReplicated.Value rs6.Update Set rs6 = Nothing curDb.Close newRec = False DoCmd.GoToRecord , "", acNewRec End If Me.Parent![sfrMain].Form.Requery Exit_cmdSaveNew_Click: Exit Sub Err_cmdSaveNew_Click: MsgBox Err.Description Resume Exit_cmdSaveNew_Click End Sub
Join the community of 500,000 technology professionals and ask your questions.