albokhiti قام بنشر نوفمبر 1, 2019 قام بنشر نوفمبر 1, 2019 السلام عليكم ورحمة الله وبركاته أساتذتي ... عندي برنامج مدارس مالي واكاديمي مقسم على قاعدتين قاعده للمالي وقاعدة للاكاديمي سؤالي هو هل ممكن عمل زر في كلا القاعدتين بحيث عند الضغط عليه يفتح او يشغل تلقائيا القاعدة الاخرى ولكم جزيل الشكر
jjafferr قام بنشر نوفمبر 1, 2019 قام بنشر نوفمبر 1, 2019 وعليكم السلام 🙂 يمكنك فتح نموذج في برنامج آخر ، هكذا : Private Sub cmd_View_Kids_info_Click() On Error GoTo err_cmd_View_Kids_info_Click 'From Personnel Application, open sfrm_Family 'if the Remote Application/Form is open, close it first appAccess.DoCmd.Quit 'now open the Form for the new Employee_ID Set appAccess = CreateObject("Access.Application") DB_Path = "\\DBs\FE\Finance_FE.accdb" appAccess.OpenCurrentDatabase (DB_Path) appAccess.DoCmd.OpenForm "sfrm_Family" appAccess.Visible = True appAccess.UserControl = True 'Set appAccess = Nothing Exit_cmd_View_Kids_info_Click: Exit Sub err_cmd_View_Kids_info_Click: If Err.Number = 91 Or Err.Number = 462 Then 'the application is NOT open, ignore the error Resume Next Else MsgBox Err.Number & vbCrLf & Err.Description End If End Sub . ويمكن ان نفتح النموذج اعلاه للقراءة فقط: Private Sub cmd_View_Kids_info_Click() On Error GoTo err_cmd_View_Kids_info_Click 'From Personnel Application, open sfrm_Family 'if the Remote Application/Form is open, close it first appAccess.DoCmd.Quit 'now open the Form for the new Employee_ID Set appAccess = CreateObject("Access.Application") DB_Path = "\\DBs\FE\Finance_FE.accdb" appAccess.OpenCurrentDatabase (DB_Path) appAccess.DoCmd.OpenForm "sfrm_Family", , , , acFormReadOnly appAccess.Visible = True appAccess.UserControl = True 'Set appAccess = Nothing Exit_cmd_View_Kids_info_Click: Exit Sub err_cmd_View_Kids_info_Click: If Err.Number = 91 Or Err.Number = 462 Then 'the application is NOT open, ignore the error Resume Next Else MsgBox Err.Number & vbCrLf & Err.Description End If End Sub . كما يمكن ان نفتح النموذج اعلاه للقراءة فقط ، مع تصفية : Private Sub cmd_View_Kids_info_Click() On Error GoTo err_cmd_View_Kids_info_Click 'From Personnel Application, open sfrm_Family 'if the Remote Application/Form is open, close it first appAccess.DoCmd.Quit 'now open the Form for the new Employee_ID Set appAccess = CreateObject("Access.Application") DB_Path = "\\DBs\FE\Finance_FE.accdb" appAccess.OpenCurrentDatabase (DB_Path) myWhere = "[Full_Name]='" & Me.frm_1_All!Full_Name & "'" myWhere = myWhere & " And [Relation]<>'زوجة'" myWhere = myWhere & " And [Relation]<>'زوج'" appAccess.DoCmd.OpenForm "sfrm_Family", , , myWhere, acFormReadOnly appAccess.Visible = True appAccess.UserControl = True 'Set appAccess = Nothing Exit_cmd_View_Kids_info_Click: Exit Sub err_cmd_View_Kids_info_Click: If Err.Number = 91 Or Err.Number = 462 Then 'the application is NOT open, ignore the error Resume Next Else MsgBox Err.Number & vbCrLf & Err.Description End If End Sub جعفر 3
SEMO.Pa3x قام بنشر نوفمبر 1, 2019 قام بنشر نوفمبر 1, 2019 عليكم السلام. طلبك ممكن وبكل بساطة. اولا: الطريقة الاولى بدون Windows API Dim cmgr As String cmgr = "مسار البرنامج الذي تريد تشغيله" 'مثال 'cmgr = "C:\WINDOWS\system32\mspaint.exe" Call Shell(cmgr, vbMaximizedFocus) ثانياً: الطريقة الثانية بإستخدام Windows API بواسطة دالة ShellExecuteA Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, _ ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, _ ByVal lpDirectory As String, ByVal lpnShowCmd As Long) As Long Public Sub ShellEx(ByVal Path As String, Optional ByVal Parameters As String, Optional ByVal HideWindow As Boolean) If Dir(Path) > "" Then ShellExecute 0, "open", Path, Parameters, "", IIf(HideWindow, 0, 1) End If End Sub 'run executable ShellEx "c:\mytool.exe" 'open file with default app ShellEx "c:\someimage.jpg" 'open explorer window ShellEx "c:\" هذا شرح مفصل عنها https://www.vb-helper.com/howto_shellexecute.html 2
albokhiti قام بنشر نوفمبر 1, 2019 الكاتب قام بنشر نوفمبر 1, 2019 (معدل) 6 ساعات مضت, jjafferr said: وعليكم السلام 🙂 6 ساعات مضت, SEMO.Pa3x said: عليكم السلام. طلبك ممكن وبكل بساطة. اولا: الطريقة الاولى بدون Windows API Dim cmgr As String cmgr = "مسار البرنامج الذي تريد تشغيله" شكرا كل الشكر لكما افدتموني جدا جدا بس عندي استفسار ولو ثقلت عليكم هل يمكن تطبيق الطريقة السابقه عن طريق ماكرو والشكر موصول لكم جميعا تم تعديل نوفمبر 1, 2019 بواسطه albokhiti
jjafferr قام بنشر نوفمبر 1, 2019 قام بنشر نوفمبر 1, 2019 وعليكم السلام 🙂 ضع هذا الكود في وحدة نمطية ، بغض النظر عن الطرق اعلاه ، ثم اعمل ماكرو ينادي هذه الوحدة النمطية. جعفر
الردود الموصى بها
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.