How to Pass a Critieria Parameter from VB to Access Query? 
Author Message
 How to Pass a Critieria Parameter from VB to Access Query?

I have an Access Query that requires a user to enter an acct#. The query
then pulls all orders by that acct#. The query works fine in Access...But
now I am building a VB app and I am trying use the same query. My question
is how do I pass the Acct# from VB to the query?

Thanks

Dan



Wed, 20 Jun 2001 03:00:00 GMT  
 How to Pass a Critieria Parameter from VB to Access Query?

Quote:

> My question
>is how do I pass the Acct# from VB to the query?

  ' declare DAO objects
  dim qdf as DAO.Querydef
  dim rs as DAO.Recordset

  ' open the query
  set qdf = dbAccountingDatabase.QueryDefs("GeneralAccounts")

  ' set the parameter
  qdf.Parameters("AccountNumber")="A12.09.09"

  ' recover the data
  set rs = qdf.OpenRecordset(dbOpenSnapshot, dbForwardOnly)

  ' etc

  ' Hope that helps

--



Thu, 21 Jun 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. passing parameters to an access db's query from VB

2. Passing Parameters to stored parameter queries using VB 5's Data Controls

3. Pass Access Query Parameters from Excel

4. Passing multiple parameters to Access query using Form List Box

5. Stored, Pass Through, Parameter Query on Access 2k and SQL Server 7

6. Executing Access queries with parameter passing

7. Executing Access queries with Data Control and parameter passing

8. Passing parameters from Visual Basic forms to Access queries

9. Passing Parameter to Access Query

10. Passing parameters to Access Query?

11. Passing parameters to Access Query from VBA

12. Passing Parameters To ACCESS query

 

 
Powered by phpBB® Forum Software