D
DaveKristof
I'm looking for a way to open a form and have it automatically check
rowcounts for multiple queries (which means you can't just link the
query to the form) in the code, but none of the methods I've found
have worked.
I'm using MS Access 2000.
I've tried copying/pasting some ADO and DAO code I found while
searching to find a fix, but none seemed to work or even come remotely
close to working and I know nothing about either.
Basically I'm trying to do this:
----------------------------------------
Private Sub Form_Load()
if Query1.RowCount > 0
<do some stuff>
end if
if Query2.RowCount > 0
<do some stuff>
end if
if Query3.RowCount > 0
<do some stuff>
end if
if Query4.RowCount > 0
<do some stuff>
end if
end sub
----------------------------------------
The only way I can figure out how to do this is to create 1 form for
each query and link the query to it, then I can use docmd.gotorecord
aclast and use CurrentRecord. But then in my mainform the Form_Load
sub I have to open 4 new forms and then tell them to modify a label or
text box on my main form to the RowCount value. Then back in my
mainform, I can check the values of the labels/textboxes and use those
values in my if statements. This is very inconvenient and very
inefficient, there must be an easy way to just get RowCount values
from any query!
Thanks in advance for any help!
rowcounts for multiple queries (which means you can't just link the
query to the form) in the code, but none of the methods I've found
have worked.
I'm using MS Access 2000.
I've tried copying/pasting some ADO and DAO code I found while
searching to find a fix, but none seemed to work or even come remotely
close to working and I know nothing about either.
Basically I'm trying to do this:
----------------------------------------
Private Sub Form_Load()
if Query1.RowCount > 0
<do some stuff>
end if
if Query2.RowCount > 0
<do some stuff>
end if
if Query3.RowCount > 0
<do some stuff>
end if
if Query4.RowCount > 0
<do some stuff>
end if
end sub
----------------------------------------
The only way I can figure out how to do this is to create 1 form for
each query and link the query to it, then I can use docmd.gotorecord
aclast and use CurrentRecord. But then in my mainform the Form_Load
sub I have to open 4 new forms and then tell them to modify a label or
text box on my main form to the RowCount value. Then back in my
mainform, I can check the values of the labels/textboxes and use those
values in my if statements. This is very inconvenient and very
inefficient, there must be an easy way to just get RowCount values
from any query!
Thanks in advance for any help!