How to Check if a form is open to update comboboxes

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
 
A

Allen Browne

Dim strForm as string
strForm = "frmWCard"
If CurrentProject.AllForms(strForm).IsLoaded Then
With Forms(strForm)
!cboCustomerID.Requery
!cboCompany_Name.Requery
End With
End With
 
B

Billp

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top