open form with =>0

  • Thread starter Thread starter Davo78
  • Start date Start date
D

Davo78

Hi All,

I have a form "INPUT" that opens with several controls populated with info
from a table "Customers" there are also blank controls for data entry and
several subforms that are set to visible = False which I currently make
visible by pressing a control button.

1 of the populated controls is "CODdue" if this control has a value greater
than zero I would like to make visible a subform "COD"

I have read through many threads and believe that DCount() is the way, but I
can't get it to work.

Thanks in Advance
Davo78
 
Use the CODdue control's AfterUpdate event to display the subform.

Sub CODdue_AfterUpdate()
If Me.CODdue > 0 Then
Me.COD.Visible = True
Else
Me.COD.Visible = False
End If
End Sub

Check in the form's current event by adding the following line to anything
else in that event:

CODdue_AfterUpdate
 
Arvin,

Thank you for your very prompt reply I have tried your suggestion but it
does not work.

I have the "COD" sub form set to visible=false, changed this to no avail.

any clues.

Davo78
 
The only possible reason that I can see that my code wouldn't work is that
the names may be different. Are you getting an error message?
 
Arvin,
No error messages, the problem appears to be with the control "CODdue" being
populated with data when the form is opened, therefore it it is not updated.

I set your code to a non populated control, when data is entered it works
fine.

Thanks again

GeoffK
 
Davo78 said:
Arvin,

Thank you for your very prompt reply I have tried your suggestion but it
does not work.

I have the "COD" sub form set to visible=false, changed this to no avail.

any clues.

Davo78
 
Back
Top