-----Original Message-----
Li,
Try this...
NumOfRecords = DCount("*", "DETAILS", "PROD=" & Me!
[PROD_NUM] & " and TYPE= " & chr(34) & "O" & chr(34))
Jeff
-----Original Message-----
Jeff,
When I use the following statement
NumOfRecords = DCount("*", "DETAILS", "PROD=" & Me!
[PROD_NUM] )
it works however, if I change it to the following
I get the error "You canceled previous operation"
NumOfRecords = DCount("*", "DETAILS", "PROD=" & Me!
[PROD_NUM] & " and TYPE=O")
Why I can't use multiple column names in my select here?
Thank you,
-Li
-----Original Message-----
Li,
This code I used as an example, did u put in your Table
Name ? Is their a field called "Type" in your Table ?
If still the error, copy & paste the acual code u are
using or if u want to Email me the database I can take
a
look at it.
Jeff
(e-mail address removed)
-----Original Message-----
Jeff,
Thanks for the reply!
I implemented this on Form Load, I get the error -
"you cancelled previous operation"
and it points me to statement
NumOfRecords = DCount("*", "TableName","Type=" & chr
(34)
& "X" & chr(34))
in my form load routine.
What I may be doing wrong?
Thank you,
-Li
-----Original Message-----
Li,
You would use the DCOUNT function to return the
number
of
records based on a condtion, Query or Table. See
help
for more details.
So for your example..
NumOfRecords = DCount("*", "TableName","Type=" & chr
(34)
& "X" & chr(34))
if NumOfRecords > 0 then
btn.Enable = TRUE 'Note Use True/False for
enabling
end if
Jeff
-----Original Message-----
I have a need to Enable/Disable buttons on a form
based on a query, what is the syntax to write
a query in form load and then
enable or disable button?
Something like
select count(*) into noofrecs from tablename where
type='X'
if noofrecs > 0 then
btn.Enable = YES
endif
Thank you,
-Li
.
.
.
.
.
.