Afficher un état sans ACCESS derrière

Rodigue_army Messages postés 13 Statut Membre -  
 youssef -
Bonjour à tous!
En ce moment ma base de données est presque achevée et cela grâce à vous. Cependant j'ai masqué l'interface d'ACCESS avec un code VBA afin d'afficher seuls les formulaires. Mon problème est que les "ETATS" n'affichent pas! Alors n'y a-t-il pas un moyen de les faire apparaître de la même manière que les formulaires?
Merci à vous!

4 réponses

  1. f894009 Messages postés 17417 Date d'inscription   Statut Membre Dernière intervention   1 717
     
    Bonjour,

    avec du code VBA:

    ex: ouverture en appercu

    stDocName = "État_Prev"
    DoCmd.OpenReport stDocName, acPreview
    0
    1. Rodigue_army Messages postés 13 Statut Membre
       
      Salut
      Désolé j'ai le code mais ça ne marche pas.
      Tu pourrais rendre le code un peu plus explicite stp.
      Genre "début-detail-fin"
      Merci
      0
  2. Rodigue_army Messages postés 13 Statut Membre
     
    Merci!
    Je vais essayer et je te ferai le retour.
    JOYEUX NOEL ET BONNE ANNEE
    0
  3. castours Messages postés 2955 Date d'inscription   Statut Membre Dernière intervention   217
     
    Bonjour
    Voici le code complet de boutons pour visualiser et imprimer un document. La c'est une facture

    Imprime la la la facture Avec acNormal

    Private Sub Commande11_Click()
    On Error GoTo Err_Commande11_Click

    Dim stDocName As String

    stDocName = "E_Factures"
    DoCmd.OpenReport stDocName, acNormal

    Exit_Commande11_Click:
    Exit Sub

    Err_Commande11_Click:
    MsgBox Err.Description
    Resume Exit_Commande11_Click

    End Sub

    Visualise la facture avec avec acPreview

    Private Sub Commande12_Click()
    On Error GoTo Err_Commande12_Click

    Dim stDocName As String

    stDocName = "E_Factures"
    DoCmd.OpenReport stDocName, acPreview

    Exit_Commande12_Click:
    Exit Sub

    Err_Commande12_Click:
    MsgBox Err.Description
    Resume Exit_Commande12_Click

    End Sub
    0
    1. Rodigue_army Messages postés 13 Statut Membre
       
      Merci.
      0
  4. Rodigue_army Messages postés 13 Statut Membre
     
    SVP les codes que vous m'avez donnés ne repondent pas à mon problème.Alors je reviens avec plus de détails.
    1-Pour masquer mon "interface ACCESS", voici le code que j'ai inséré dans un "MODULE":

    "Option Compare Database

    'Déclaration API
    Const SW_HIDE = 0 'Hide the window.
    Const SW_MAXIMIZE = 3 'Maximize the window.
    Const SW_MINIMIZE = 6 'Minimize the window.
    Const SW_RESTORE = 9 'Restore the window (not maximized nor minimized).
    Const SW_SHOW = 5 'Show the window.
    Const SW_SHOWMAXIMIZED = 3 'Show the window maximized.
    Const SW_SHOWMINIMIZED = 2 'Show the window minimized.
    Const SW_SHOWMINNOACTIVE = 7 'Show the window minimized but do not activate it.
    Const SW_SHOWNA = 8 'Show the window in its current state but do not activate it.
    Const SW_SHOWNOACTIVATE = 4 'Show the window in its most recent size and position but do not activate it.
    Const SW_SHOWNORMAL = 1 'Show the window and activate it (as usual).

    Public Declare Function ShowWindow Lib "User32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long

    'minimise la fenetre access et active le formulaire
    Function Fenetre_Modale(pForm As Form)
    ShowWindow Application.hWndAccessApp, SW_HIDE
    ShowWindow pForm.hWnd, SW_SHOWNORMAL
    ShowWindow Application.hWndAccessApp, SW_SHOWMINNOACTIVE

    End Function"

    2-Pour afficher mes formulaire sans ACCESS en arrière plan, voici le code que j'ai inséré dans le générateur de code des formulaire:
    "Private Sub Form_Load()
    'Ouverture du formualire sans la fenêtre principale Access
    ShowWindow Application.hWndAccessApp, 0
    End Sub"

    3-Maintenant les formulaires s'affichent seul et sans aucun problèmes.
    PROBLEME: DèS QUE JE LANCE L'OUVERTURE DES ETATS A PARTIR DES BOUTON COMMANDES SUR FORMULAIRES, NON SEULEMENT CES ETATS NE S'OUVRENT PAS MAIS LES LES FORMULAIS SONT FIGES M'OBLIGEANT A REDÉMARRER MON PC.
    Alors n'y a t-il pas un code comme en 2-, me permettant d'ouvrir ces états sans que ma BD se fige?
    Merci j'attends vivement vos réponses
    0
    1. castours Messages postés 2955 Date d'inscription   Statut Membre Dernière intervention   217
       
      Bonjour
      Tu peux poser ton probleme sur le forum de programmation VBA
      0
    2. youssef
       
      Salut tu peu tout simplement imprimer les État directement sans aperçu
      0