problem with code

yoavchen

Registered User.
Local time
Today, 09:25
Joined
Jan 31, 2005
Messages
53
i am trying to execute a query that give me a list of companies.
in the query i put parameter with the operator like.
i am trying to limit the company names that i get into 5, which mean, if the form is opened with more then 5 records, i want to hide this field.

i did a simple code:

Private Sub Form_Load()
Me.count1 = Form_searchsecond.countcomp
If Me.count1 > 5 Then
Form_searchsecond.Visible = False
End If
End Sub

when i debug the code the number from "countcomp" is getting into "count1"
which is fine.
but when i run the it regulary it stays empty.....
how could it be

please advice
thanks
 
It sounds like some sort of timing issue. How about a little more detail?

What is the name of this form?

What is "Form_searchsecond"? Is it a control on this form?

How about "Form_searchsecond.countcomp"?

Did you Copy /Paste your code or re-type it for this post?
 

Users who are viewing this thread

Back
Top Bottom