Private Sub listenat_Click() Me.ListeChemin.RowSource = "SELECT [Nature].[Chemin] FROM Nature " _ & "WHERE ((([Nature].[NomNature]) like '*" & Me.listenat & "*'));" DoCmd.GoToControl "ListeChemin" ListeChemin.Dropdown End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionSub OuvrirFichier() Dim wApp As Word.Application 'Dim oDoc As Word.Document Dim SQL As String Dim oDB As DAO.Database Dim rs As DAO.Recordset SQL = "SELECT * From tbl1" Set oDB = CurrentDb Set rs = oDB.OpenRecordset(SQL) Set wApp = New Word.Application wApp.Visible = True While Not rs.EOF wApp.Documents.Open (rs.Fields(1).Value) rs.MoveNext Wend 'Set wApp = Nothing Set rs = Nothing Set oDB = Nothing End Sub
Sub Macro1() ' ' Macro1 Macro ' ' End Sub
Dim r As Long With ActiveDocument For r = 1 To .Words.Count If Trim(.Words(r).Text) = "LeMotàChercher" Then Debug.Print .Words(r) End If Next End WithAttention aux min/maj (A n'est pas a)
? maVariablepour qu'elle s'inscrive dans la fenêtre.
If Trim(.Words(r).Text) = "RAC1" Then
Dim wApp As Word.Application Dim wDocument As Word.Document Set wApp = New Word.Application wApp.Visible = True While Not rs.EOF Set wDocument = wApp.Documents.Open(rs.Fields(1).Value) '...Ici, il faudra utiliser wDocument
Private Sub listenat_Click() Me.ListeChemin.RowSource = "SELECT [NatureLac].[Chemin] FROM Nature " _ & "WHERE ((([Nature].[NomNature])= listenat));" DoCmd.GoToControl "ListeChemin" ListeChemin.Dropdown End Sub