1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
| Private Sub Form_Open(Cancel As Integer)
'Agrandi la fenetre au maximum
DoCmd.Maximize
'Ajuste l 'affichage de la page à la taille de l'écran
appui_touche (90)
Dim txt_ChaineSQL As String
Dim Liste_VracArrivee As ListBox
Dim Liste_ArriveeQuai As ListBox
With Me.Liste_VracArrivee
.ColumnHeads = True
.ColumnCount = 7 ' nombre de colonne que dois avoir la listebox
.BoundColumn = 1 ' la colonne de reference
.RowSource = "Table/Requête"
StrSQLSELECT = "SELECT tb_Liaison.No_Liaison, tb_ProvDest.Nom_Ville, tb_TypeLiaison.Type," & _
"tb_FrequenceLiaison.Frequence, tb_Liaison.Heure_Theo, tb_Remorque.No_remorque, tb_Liaison.Commentaires," & _
"tb_Liaison.Selection"
strSQLFROM = "FROM tb_FrequenceLiaison INNER JOIN (tb_ProvDest INNER JOIN (tb_TypeLiaison INNER JOIN" & _
"(tb_Remorque INNER JOIN tb_Liaison ON tb_Remorque.id_remorque=tb_Liaison.No_Remorque) ON " & _
"tb_TypeLiaison.id_TypeLiaison=tb_Liaison.Mvt_Type) ON tb_ProvDest.id_ProvDest=tb_Liaison.Prov_Dest)" & _
"ON tb_FrequenceLiaison.id_TypeFrequence=tb_Liaison.Freq_Type"
strSQLWHERE = "WHERE NOT Selection;"
txt_ChaineSQL = StrSQLSELECT & vbCrLf & _
strSQLFROM & vbCrLf & _
strSQLWHERE
.RowSource = txt_ChaineSQL
.Requery
'Debug.Print txt_ChaineSQL
End With
With Me.Liste_ArriveeQuai
.ColumnHeads = True
.ColumnCount = 7 ' nombre de colonne que dois avoir la listebox
.BoundColumn = 1 ' la colonne de reference
.RowSource = "Table/Requête"
StrSQLSELECT = "SELECT tb_Liaison.No_Liaison, tb_ProvDest.Nom_Ville, tb_TypeLiaison.Type," & _
"tb_FrequenceLiaison.Frequence, tb_Liaison.Heure_Theo, tb_Remorque.No_remorque, tb_Liaison.Commentaires," & _
"tb_Liaison.Selection"
strSQLFROM = "FROM tb_FrequenceLiaison INNER JOIN (tb_ProvDest INNER JOIN (tb_TypeLiaison INNER JOIN" & _
"(tb_Remorque INNER JOIN tb_Liaison ON tb_Remorque.id_remorque=tb_Liaison.No_Remorque) ON " & _
"tb_TypeLiaison.id_TypeLiaison=tb_Liaison.Mvt_Type) ON tb_ProvDest.id_ProvDest=tb_Liaison.Prov_Dest)" & _
"ON tb_FrequenceLiaison.id_TypeFrequence=tb_Liaison.Freq_Type"
strSQLWHERE = "WHERE Selection;"
txt_ChaineSQL = StrSQLSELECT & vbCrLf & _
strSQLFROM & vbCrLf & _
strSQLWHERE
.RowSource = txt_ChaineSQL
.Requery
'Debug.Print txt_ChaineSQL
End With
End Sub |
Partager