open form with =>0

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
 
A

Arvin Meyer MVP

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
 
D

Davo78

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
 
A

Arvin Meyer MVP

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?
 
D

Davo78

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
 
J

Jana Roubalova

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
 

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