اذهب الي المحتوي
أوفيسنا

فتح قاعدة بيانات خارجيه من قاعدة البيانات التي اعمل عليها


albokhiti

الردود الموصى بها

السلام عليكم ورحمة الله وبركاته

أساتذتي ... 

عندي برنامج مدارس مالي واكاديمي مقسم على قاعدتين قاعده للمالي وقاعدة للاكاديمي 

 

سؤالي هو

هل ممكن عمل زر في كلا القاعدتين بحيث عند الضغط عليه يفتح او يشغل تلقائيا القاعدة الاخرى

 

 

ولكم جزيل الشكر 

رابط هذا التعليق
شارك

وعليكم السلام 🙂

 

يمكنك فتح نموذج في برنامج آخر ، هكذا :

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

 

جعفر

 

 

  • Like 3
رابط هذا التعليق
شارك

عليكم السلام. طلبك ممكن  وبكل بساطة.

 

اولا: الطريقة الاولى بدون 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

 

  • Like 2
رابط هذا التعليق
شارك

6 ساعات مضت, jjafferr said:

وعليكم السلام 🙂

 

 

 

 

6 ساعات مضت, SEMO.Pa3x said:

عليكم السلام. طلبك ممكن  وبكل بساطة.

 

اولا: الطريقة الاولى بدون Windows API

 


Dim cmgr As String
cmgr = "مسار البرنامج الذي تريد تشغيله" 

شكرا كل الشكر لكما 

 

افدتموني جدا جدا

بس عندي استفسار ولو ثقلت عليكم

هل يمكن تطبيق الطريقة السابقه عن طريق ماكرو

 

والشكر موصول لكم جميعا

تم تعديل بواسطه albokhiti
رابط هذا التعليق
شارك

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information