Etxezarreta
Member
- Local time
- Today, 11:17
- Joined
- Apr 13, 2020
- Messages
- 175
Hello everyone,
I have a form called "sf_re_ResultatRecherche" based on a querydefs called "re_ResultatRecherche".
This form is included in a form called "DSP_RDV_PREPA_f_CreationListeAppels": the name of the subform in the form is sff_re_ResultatRecherche.
When the VBA code runs, the querydefs is updated, and so is the form sf_re_ResultatRecherche.
But the subform sff_re_ResultatRecherche wouldn't refresh in the form:
here is my code:
Many thanks for your suggestions.
Etxe
I have a form called "sf_re_ResultatRecherche" based on a querydefs called "re_ResultatRecherche".
This form is included in a form called "DSP_RDV_PREPA_f_CreationListeAppels": the name of the subform in the form is sff_re_ResultatRecherche.
When the VBA code runs, the querydefs is updated, and so is the form sf_re_ResultatRecherche.
But the subform sff_re_ResultatRecherche wouldn't refresh in the form:
here is my code:
Code:
str_SQL_finale = "SELECT ID_Contact, " & _
"Nom_contact, Prenom_contact, Nom_structure, Fonction, FK_Specialite, FK_Profession, Departement, " & _
"Secteur, Case_du_plan, Adresse_1, Ville, Secretariat_telephonique, Tel1, Courriel, Integrer_liste_appels " & _
"FROM Contacts_t_ListeContacts " & _
"WHERE " & strAllCriteria & " ORDER BY Nom_contact ASC ;"
Debug.Print (str_SQL_finale)
CurrentDb.QueryDefs("re_ResultatRecherche").SQL = str_SQL_finale
'Forms!sf_re_ResultatRecherche.Requery
Forms!DSP_RDV_PREPA_f_CreationListeAppels!sff_re_ResultatRecherche.Form.Requery
Forms!DSP_RDV_PREPA_f_CreationListeAppels!sff_re_ResultatRecherche.Form.Refresh
'Me.sff_re_ResultatRecherche.Form.Requery
Me.Requery
'Me.sff_re_ResultatRecherche.Form.Refresh
Me.Refresh
'Me.sff_re_ResultatRecherche.Form.Repaint
Me.Repaint
'21/06: Ezinbertzekoa
DoCmd.Hourglass False
Application.Echo True
objConnection.Close
Set objConnection = Nothing
Exit Sub
GestionnaireErreur:
MsgBox "Une erreur s'est produite: " & Err.Number & "-" & Err.Description, vbOKOnly + vbInformation
Exit Sub
EnregistrementVide:
MsgBox "Pas d'enregistrement correspondantà votre demande", vbOKOnly + vbInformation
End Sub
Etxe