Akram Galal قام بنشر يونيو 28, 2017 قام بنشر يونيو 28, 2017 السادة الأفاضل أعضاء المنتدى كل عام وأنتم بخير أريد كود يقوم بالأتي عند الضغط علي زر × مع وجود خلية معينة فارغة تظهر رسالة "برجاء اكمال البيانات" ويتم الغاء المر الإغلاق والعودة للفورم بدون مسح البيانات الموجوده بها جزاكم الله خيرا .
jjafferr قام بنشر يونيو 28, 2017 قام بنشر يونيو 28, 2017 وعليكم السلام 1. يجب تعطيل X النموذج من اعدادات النموذج ، 2. عمل زر لإغلاق النموذج ، 3. استعمال هذا الكود: كود زر اغلاق النموذج Private Sub cmd_close_Click() Call Form_BeforeUpdate(False) End Sub Private Sub Form_BeforeUpdate(Cancel As Integer) On Error GoTo err_Form_BeforeUpdate Dim ctl As Control For Each ctl In Me.Controls If ctl.ControlType = acTextBox Or _ ctl.ControlType = acOptionGroup Or _ ctl.ControlType = acComboBox Or _ ctl.ControlType = acListBox Then If Len(ctl.Value & "") = 0 Then MsgBox "رجاء ادخال بيانات في الحقل " & vbCrLf & ctl.Name ctl.SetFocus Exit Sub End If 'Len End If 'ctl Next DoCmd.Close Exit_Form_BeforeUpdate: Exit Sub err_Form_BeforeUpdate: If Err.Number = 2501 Then Resume Exit_Form_BeforeUpdate Else MsgBox Err.Number & vbCrLf & Err.Description End If End Sub جعفر
الردود الموصى بها
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.