How to Check if a form is open to update comboboxes

  • Thread starter Thread starter Billp
  • Start date Start date
B

Billp

Greetings,

I have a customer form, to which new customers are added.

In a another form, called WorksCard if a customer is not in the list, it
opens the same customer form - the form will not be opened twice.

When this form closes I would like to test if the other form is open and if
so requery some combo boxes - what I have thought about is

If Forms!frmWCard.Open = True Then
Forms!frmWCard.cboCustomerID.Requery
Forms!frmWCard.cboCompany_Name.Requery
Else
'do nothing
End If


So that if the customer form is only being used for addition of customers it
will not try to update combo boxes which are not open - ?????????

Thanks In Advance
Regards
 
Dim strForm as string
strForm = "frmWCard"
If CurrentProject.AllForms(strForm).IsLoaded Then
With Forms(strForm)
!cboCustomerID.Requery
!cboCompany_Name.Requery
End With
End With
 
Many Thanks Allen,

very appreciative.
Regards

Allen Browne said:
Dim strForm as string
strForm = "frmWCard"
If CurrentProject.AllForms(strForm).IsLoaded Then
With Forms(strForm)
!cboCustomerID.Requery
!cboCompany_Name.Requery
End With
End With
 
Back
Top