querydef or ADO on sub forms data

  • Thread starter Thread starter ChrisA
  • Start date Start date
C

ChrisA

Hi have a subform that is based on a query "qInventoryTransactions". I am
trying to requery the subform "Transaction" based on a selection made from a
combo box "Province" in the main form "Parts". In DAO I could use querydef
but now in ADO doesn't seem to work or be there. Using Access 2000.

Tried using some code found from a Microsoft Article 255782 but get hung up
on mcat.Views("qInventoryTransactioins") error says it can't find it.
Checked spelling references etc and all seems to be as per the article.

Set mcat = New ADOX.Catalog
Set mcat.ActiveConnection = CurrentProject.Connection

Set mview = mcat.Views("qInventoryTransactions")
Set cmd = mview.Command

cmd.CommandText = qInventoryTransactions
Set mview.Command = cmd


Is there a simple way of doing this.
Regards
Chris
 
Still interested to hear the solution for ADO and querydef but managed to
make the following work in the criteria for the query

IIf([Forms]![ProductsInv].[cboProv]<>"ALL",[Forms]![ProductsInv].[cboProv],[
Location]) Or Is Null)

Thanks for any info
Chris
 
Back
Top