Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

lost with what to do!!!!

ok, quick summary.... vb 6.0 application. access 2000 DB with 1 table. my application need to pop up a form that(which it does now) has search criteria, run the query i created in access, and display the results on a new VB form.
list of forms and etc...

frmResults = result form using a ADODB data controller
dialog = search criteria form. (dont know if i need to bind the text boxes to a ADO controller or not???)

access query
access form that allows me to enter search criteria and runs the query.
these are my problems to date

frmResults also has a dgdfilter datagrid
it also hase 5 labels which display the search results from the dialog form.

i also createda a form in access that does what i want to do, BUT i need to do the same in VB.

how can i have my VB Dialog form when enabled, have the criteria run the query(Access), and have the query results display ed on form frmresults in VB?
***********************************************************************
Please help

«1

Comments

  • GideonOmegaGideonOmega Member Posts: 617
    : ok, quick summary.... vb 6.0 application. access 2000 DB with 1 table. my application need to pop up a form that(which it does now) has search criteria, run the query i created in access, and display the results on a new VB form.
    : list of forms and etc...
    :
    : frmResults = result form using a ADODB data controller
    : dialog = search criteria form. (dont know if i need to bind the text boxes to a ADO controller or not???)
    :
    : access query
    : access form that allows me to enter search criteria and runs the query.
    : these are my problems to date
    :
    : frmResults also has a dgdfilter datagrid
    : it also hase 5 labels which display the search results from the dialog form.
    :
    : i also createda a form in access that does what i want to do, BUT i need to do the same in VB.
    :
    : how can i have my VB Dialog form when enabled, have the criteria run the query(Access), and have the query results display ed on form frmresults in VB?
    : ***********************************************************************
    : Please help
    :
    :
    you can add a ADO data Control to your project and set your data grid's data source to equal your ado control, then to equal your qry results set the ado datacontrols record source property to execute your qry, then refresh it and then refresh your data grid and it will show the results of your query.
    [blue]
    C:Dos
    C:Dos Run
    Run Dos Run
    [/blue]

  • jlawren7jlawren7 Member Posts: 19
    : : ok, quick summary.... vb 6.0 application. access 2000 DB with 1 table. my application need to pop up a form that(which it does now) has search criteria, run the query i created in access, and display the results on a new VB form.
    : : list of forms and etc...
    : :
    : : frmResults = result form using a ADODB data controller
    : : dialog = search criteria form. (dont know if i need to bind the text boxes to a ADO controller or not???)
    : :
    : : access query
    : : access form that allows me to enter search criteria and runs the query.
    : : these are my problems to date
    : :
    : : frmResults also has a dgdfilter datagrid
    : : it also hase 5 labels which display the search results from the dialog form.
    : :
    : : i also createda a form in access that does what i want to do, BUT i need to do the same in VB.
    : :
    : : how can i have my VB Dialog form when enabled, have the criteria run the query(Access), and have the query results display ed on form frmresults in VB?
    : : ***********************************************************************
    : : Please help
    : :
    : :
    : you can add a ADO data Control to your project and set your data grid's data source to equal your ado control, then to equal your qry results set the ado datacontrols record source property to execute your qry, then refresh it and then refresh your data grid and it will show the results of your query.
    : [blue]
    : C:Dos
    : C:Dos Run
    : Run Dos Run
    : [/blue]
    :
    :
    **********************************************************************

    i tried this, and i get an error of "adodbquery" <---is in the title
    "to few parameters:expected 5"

    i dont understand that statement
    i have a form in access that allows me to enter the search criteria, i cant seem to link that form to VB but the query if you run it in access, it has 5 input boxes asking for the search criteria

  • GideonOmegaGideonOmega Member Posts: 617
    : : : ok, quick summary.... vb 6.0 application. access 2000 DB with 1 table. my application need to pop up a form that(which it does now) has search criteria, run the query i created in access, and display the results on a new VB form.
    : : : list of forms and etc...
    : : :
    : : : frmResults = result form using a ADODB data controller
    : : : dialog = search criteria form. (dont know if i need to bind the text boxes to a ADO controller or not???)
    : : :
    : : : access query
    : : : access form that allows me to enter search criteria and runs the query.
    : : : these are my problems to date
    : : :
    : : : frmResults also has a dgdfilter datagrid
    : : : it also hase 5 labels which display the search results from the dialog form.
    : : :
    : : : i also createda a form in access that does what i want to do, BUT i need to do the same in VB.
    : : :
    : : : how can i have my VB Dialog form when enabled, have the criteria run the query(Access), and have the query results display ed on form frmresults in VB?
    : : : ***********************************************************************
    : : : Please help
    : : :
    : : :
    : : you can add a ADO data Control to your project and set your data grid's data source to equal your ado control, then to equal your qry results set the ado datacontrols record source property to execute your qry, then refresh it and then refresh your data grid and it will show the results of your query.
    : : [blue]
    : : C:Dos
    : : C:Dos Run
    : : Run Dos Run
    : : [/blue]
    : :
    : :
    : **********************************************************************
    :
    : i tried this, and i get an error of "adodbquery" <---is in the title
    : "to few parameters:expected 5"
    :
    : i dont understand that statement
    : i have a form in access that allows me to enter the search criteria, i cant seem to link that form to VB but the query if you run it in access, it has 5 input boxes asking for the search criteria
    :
    :


    The error that you got is because your query is expecting you to pass it 5 parameters, if you use an ado control to execute a query then you need to make sure to change the type(in the record source builder) to adcmdProc instead of the adcmdText. you may need to do a search on here or google as to how to pass the parameters through the ado as I haven't tried that with access before and I'm not sure of the syntax. The only way I know for sure how to to that is with the parameters collection of the command object - as I have done that with sql server before, but if you do it that way as far as I know you would then need to keep the Recordset in your code open for as long as you wanted to view the code in the data grid.

    so I think your best bet is to do a search on passing parameters to access through vb, then you should beable to do it through a data control.


    Hope this helps.
    [blue]
    C:Dos
    C:Dos Run
    Run Dos Run
    [/blue]

  • jlawren7jlawren7 Member Posts: 19
    [b][red]This message was edited by jlawren7 at 2004-4-2 10:17:42[/red][/b][hr]
    [b][red]This message was edited by jlawren7 at 2004-4-2 7:44:58[/red][/b][hr]
    : : : : ok, quick summary.... vb 6.0 application. access 2000 DB with 1 table. my application need to pop up a form that(which it does now) has search criteria, run the query i created in access, and display the results on a new VB form.
    : : : : list of forms and etc...
    : : : :
    : : : : frmResults = result form using a ADODB data controller
    : : : : dialog = search criteria form. (dont know if i need to bind the text boxes to a ADO controller or not???)
    : : : :
    : : : : access query
    : : : : access form that allows me to enter search criteria and runs the query.
    : : : : these are my problems to date
    : : : :
    : : : : frmResults also has a dgdfilter datagrid
    : : : : it also hase 5 labels which display the search results from the dialog form.
    : : : :
    : : : : i also createda a form in access that does what i want to do, BUT i need to do the same in VB.
    : : : :
    : : : : how can i have my VB Dialog form when enabled, have the criteria run the query(Access), and have the query results display ed on form frmresults in VB?
    : : : : ***********************************************************************
    : : : : Please help
    : : : :
    : : : :
    : : : you can add a ADO data Control to your project and set your data grid's data source to equal your ado control, then to equal your qry results set the ado datacontrols record source property to execute your qry, then refresh it and then refresh your data grid and it will show the results of your query.
    : : : [blue]
    : : : C:Dos
    : : : C:Dos Run
    : : : Run Dos Run
    : : : [/blue]
    : : :
    : : :
    : : **********************************************************************
    : :
    : : i tried this, and i get an error of "adodbquery" <---is in the title
    : : "to few parameters:expected 5"
    : :
    : : i dont understand that statement
    : : i have a form in access that allows me to enter the search criteria, i cant seem to link that form to VB but the query if you run it in access, it has 5 input boxes asking for the search criteria
    : :
    : :
    :
    :
    : The error that you got is because your query is expecting you to pass it 5 parameters, if you use an ado control to execute a query then you need to make sure to change the type(in the record source builder) to adcmdProc instead of the adcmdText. you may need to do a search on here or google as to how to pass the parameters through the ado as I haven't tried that with access before and I'm not sure of the syntax. The only way I know for sure how to to that is with the parameters collection of the command object - as I have done that with sql server before, but if you do it that way as far as I know you would then need to keep the Recordset in your code open for as long as you wanted to view the code in the data grid.
    :
    : so I think your best bet is to do a search on passing parameters to access through vb, then you should beable to do it through a data control.
    :
    :
    : Hope this helps.
    : [blue]
    : C:Dos
    : C:Dos Run
    : Run Dos Run
    : [/blue]
    :
    :
    ***********************************************************************

    thats what i did as of last night. put an ADO control on my dialog form, pointed it to the query. on my results form, the datagrid filter is also pointing to the query. i get the error message when i click my button on mt main form which launches my dialog form. i also get the same message when i termionate the program. as you stated, i "C" dos run and Run he does.

    *********************************************************************
    this is the message i get now "the microsoft jet daTABASE ENGINE COULD NOT FIND THE INPUT TABLE OR THE QUERY 'DIALOG'.




  • GideonOmegaGideonOmega Member Posts: 617
    : [b][red]This message was edited by jlawren7 at 2004-4-2 10:17:42[/red][/b][hr]
    : [b][red]This message was edited by jlawren7 at 2004-4-2 7:44:58[/red][/b][hr]
    : : : : : ok, quick summary.... vb 6.0 application. access 2000 DB with 1 table. my application need to pop up a form that(which it does now) has search criteria, run the query i created in access, and display the results on a new VB form.
    : : : : : list of forms and etc...
    : : : : :
    : : : : : frmResults = result form using a ADODB data controller
    : : : : : dialog = search criteria form. (dont know if i need to bind the text boxes to a ADO controller or not???)
    : : : : :
    : : : : : access query
    : : : : : access form that allows me to enter search criteria and runs the query.
    : : : : : these are my problems to date
    : : : : :
    : : : : : frmResults also has a dgdfilter datagrid
    : : : : : it also hase 5 labels which display the search results from the dialog form.
    : : : : :
    : : : : : i also createda a form in access that does what i want to do, BUT i need to do the same in VB.
    : : : : :
    : : : : : how can i have my VB Dialog form when enabled, have the criteria run the query(Access), and have the query results display ed on form frmresults in VB?
    : : : : : ***********************************************************************
    : : : : : Please help
    : : : : :
    : : : : :
    : : : : you can add a ADO data Control to your project and set your data grid's data source to equal your ado control, then to equal your qry results set the ado datacontrols record source property to execute your qry, then refresh it and then refresh your data grid and it will show the results of your query.
    : : : : [blue]
    : : : : C:Dos
    : : : : C:Dos Run
    : : : : Run Dos Run
    : : : : [/blue]
    : : : :
    : : : :
    : : : **********************************************************************
    : : :
    : : : i tried this, and i get an error of "adodbquery" <---is in the title
    : : : "to few parameters:expected 5"
    : : :
    : : : i dont understand that statement
    : : : i have a form in access that allows me to enter the search criteria, i cant seem to link that form to VB but the query if you run it in access, it has 5 input boxes asking for the search criteria
    : : :
    : : :
    : :
    : :
    : : The error that you got is because your query is expecting you to pass it 5 parameters, if you use an ado control to execute a query then you need to make sure to change the type(in the record source builder) to adcmdProc instead of the adcmdText. you may need to do a search on here or google as to how to pass the parameters through the ado as I haven't tried that with access before and I'm not sure of the syntax. The only way I know for sure how to to that is with the parameters collection of the command object - as I have done that with sql server before, but if you do it that way as far as I know you would then need to keep the Recordset in your code open for as long as you wanted to view the code in the data grid.
    : :
    : : so I think your best bet is to do a search on passing parameters to access through vb, then you should beable to do it through a data control.
    : :
    : :
    : : Hope this helps.
    : : [blue]
    : : C:Dos
    : : C:Dos Run
    : : Run Dos Run
    : : [/blue]
    : :
    : :
    : ***********************************************************************
    :
    : thats what i did as of last night. put an ADO control on my dialog form, pointed it to the query. on my results form, the datagrid filter is also pointing to the query. i get the error message when i click my button on mt main form which launches my dialog form. i also get the same message when i termionate the program. as you stated, i "C" dos run and Run he does.
    :
    : *********************************************************************
    : this is the message i get now "the microsoft jet daTABASE ENGINE COULD NOT FIND THE INPUT TABLE OR THE QUERY 'DIALOG'.
    :
    :
    :
    :
    :
    as I was saying before, I'm not familer with the methods used outside of access to pass parameters into a qry, with the exception of the parameters collection in ado command objects - which I have never tested with access.

    How are you trying to pass the parameters to the qry? As you where saying, you have a qry that expects 5 parameters, and if you don't provide those param's then it will fail.
    [blue]
    C:Dos
    C:Dos Run
    Run Dos Run
    [/blue]

  • jlawren7jlawren7 Member Posts: 19
    : : [b][red]This message was edited by jlawren7 at 2004-4-2 10:17:42[/red][/b][hr]
    : : [b][red]This message was edited by jlawren7 at 2004-4-2 7:44:58[/red][/b][hr]
    : : : : : : ok, quick summary.... vb 6.0 application. access 2000 DB with 1 table. my application need to pop up a form that(which it does now) has search criteria, run the query i created in access, and display the results on a new VB form.
    : : : : : : list of forms and etc...
    : : : : : :
    : : : : : : frmResults = result form using a ADODB data controller
    : : : : : : dialog = search criteria form. (dont know if i need to bind the text boxes to a ADO controller or not???)
    : : : : : :
    : : : : : : access query
    : : : : : : access form that allows me to enter search criteria and runs the query.
    : : : : : : these are my problems to date
    : : : : : :
    : : : : : : frmResults also has a dgdfilter datagrid
    : : : : : : it also hase 5 labels which display the search results from the dialog form.
    : : : : : :
    : : : : : : i also createda a form in access that does what i want to do, BUT i need to do the same in VB.
    : : : : : :
    : : : : : : how can i have my VB Dialog form when enabled, have the criteria run the query(Access), and have the query results display ed on form frmresults in VB?
    : : : : : : ***********************************************************************
    : : : : : : Please help
    : : : : : :
    : : : : : :
    : : : : : you can add a ADO data Control to your project and set your data grid's data source to equal your ado control, then to equal your qry results set the ado datacontrols record source property to execute your qry, then refresh it and then refresh your data grid and it will show the results of your query.
    : : : : : [blue]
    : : : : : C:Dos
    : : : : : C:Dos Run
    : : : : : Run Dos Run
    : : : : : [/blue]
    : : : : :
    : : : : :
    : : : : **********************************************************************
    : : : :
    : : : : i tried this, and i get an error of "adodbquery" <---is in the title
    : : : : "to few parameters:expected 5"
    : : : :
    : : : : i dont understand that statement
    : : : : i have a form in access that allows me to enter the search criteria, i cant seem to link that form to VB but the query if you run it in access, it has 5 input boxes asking for the search criteria
    : : : :
    : : : :
    : : :
    : : :
    : : : The error that you got is because your query is expecting you to pass it 5 parameters, if you use an ado control to execute a query then you need to make sure to change the type(in the record source builder) to adcmdProc instead of the adcmdText. you may need to do a search on here or google as to how to pass the parameters through the ado as I haven't tried that with access before and I'm not sure of the syntax. The only way I know for sure how to to that is with the parameters collection of the command object - as I have done that with sql server before, but if you do it that way as far as I know you would then need to keep the Recordset in your code open for as long as you wanted to view the code in the data grid.
    : : :
    : : : so I think your best bet is to do a search on passing parameters to access through vb, then you should beable to do it through a data control.
    : : :
    : : :
    : : : Hope this helps.
    : : : [blue]
    : : : C:Dos
    : : : C:Dos Run
    : : : Run Dos Run
    : : : [/blue]
    : : :
    : : :
    : : ***********************************************************************
    : :
    : : thats what i did as of last night. put an ADO control on my dialog form, pointed it to the query. on my results form, the datagrid filter is also pointing to the query. i get the error message when i click my button on mt main form which launches my dialog form. i also get the same message when i termionate the program. as you stated, i "C" dos run and Run he does.
    : :
    : : *********************************************************************
    : : this is the message i get now "the microsoft jet daTABASE ENGINE COULD NOT FIND THE INPUT TABLE OR THE QUERY 'DIALOG'.
    : :
    : :
    : :
    : :
    : :
    : as I was saying before, I'm not familer with the methods used outside of access to pass parameters into a qry, with the exception of the parameters collection in ado command objects - which I have never tested with access.
    :
    : How are you trying to pass the parameters to the qry? As you where saying, you have a qry that expects 5 parameters, and if you don't provide those param's then it will fail.
    : [blue]
    : C:Dos
    : C:Dos Run
    : Run Dos Run
    : [/blue]
    :
    :*************************************************************************WELl FOR A UPDATE...

    i/ve basically been teaching myself SQL so i can try to connect. anyone out there now how to or if you can, create a sql string that searches the DB based on what is showing in labwels on a VB form?


  • GideonOmegaGideonOmega Member Posts: 617
    : : : [b][red]This message was edited by jlawren7 at 2004-4-2 10:17:42[/red][/b][hr]
    : : : [b][red]This message was edited by jlawren7 at 2004-4-2 7:44:58[/red][/b][hr]
    : : : : : : : ok, quick summary.... vb 6.0 application. access 2000 DB with 1 table. my application need to pop up a form that(which it does now) has search criteria, run the query i created in access, and display the results on a new VB form.
    : : : : : : : list of forms and etc...
    : : : : : : :
    : : : : : : : frmResults = result form using a ADODB data controller
    : : : : : : : dialog = search criteria form. (dont know if i need to bind the text boxes to a ADO controller or not???)
    : : : : : : :
    : : : : : : : access query
    : : : : : : : access form that allows me to enter search criteria and runs the query.
    : : : : : : : these are my problems to date
    : : : : : : :
    : : : : : : : frmResults also has a dgdfilter datagrid
    : : : : : : : it also hase 5 labels which display the search results from the dialog form.
    : : : : : : :
    : : : : : : : i also createda a form in access that does what i want to do, BUT i need to do the same in VB.
    : : : : : : :
    : : : : : : : how can i have my VB Dialog form when enabled, have the criteria run the query(Access), and have the query results display ed on form frmresults in VB?
    : : : : : : : ***********************************************************************
    : : : : : : : Please help
    : : : : : : :
    : : : : : : :
    : : : : : : you can add a ADO data Control to your project and set your data grid's data source to equal your ado control, then to equal your qry results set the ado datacontrols record source property to execute your qry, then refresh it and then refresh your data grid and it will show the results of your query.
    : : : : : : [blue]
    : : : : : : C:Dos
    : : : : : : C:Dos Run
    : : : : : : Run Dos Run
    : : : : : : [/blue]
    : : : : : :
    : : : : : :
    : : : : : **********************************************************************
    : : : : :
    : : : : : i tried this, and i get an error of "adodbquery" <---is in the title
    : : : : : "to few parameters:expected 5"
    : : : : :
    : : : : : i dont understand that statement
    : : : : : i have a form in access that allows me to enter the search criteria, i cant seem to link that form to VB but the query if you run it in access, it has 5 input boxes asking for the search criteria
    : : : : :
    : : : : :
    : : : :
    : : : :
    : : : : The error that you got is because your query is expecting you to pass it 5 parameters, if you use an ado control to execute a query then you need to make sure to change the type(in the record source builder) to adcmdProc instead of the adcmdText. you may need to do a search on here or google as to how to pass the parameters through the ado as I haven't tried that with access before and I'm not sure of the syntax. The only way I know for sure how to to that is with the parameters collection of the command object - as I have done that with sql server before, but if you do it that way as far as I know you would then need to keep the Recordset in your code open for as long as you wanted to view the code in the data grid.
    : : : :
    : : : : so I think your best bet is to do a search on passing parameters to access through vb, then you should beable to do it through a data control.
    : : : :
    : : : :
    : : : : Hope this helps.
    : : : : [blue]
    : : : : C:Dos
    : : : : C:Dos Run
    : : : : Run Dos Run
    : : : : [/blue]
    : : : :
    : : : :
    : : : ***********************************************************************
    : : :
    : : : thats what i did as of last night. put an ADO control on my dialog form, pointed it to the query. on my results form, the datagrid filter is also pointing to the query. i get the error message when i click my button on mt main form which launches my dialog form. i also get the same message when i termionate the program. as you stated, i "C" dos run and Run he does.
    : : :
    : : : *********************************************************************
    : : : this is the message i get now "the microsoft jet daTABASE ENGINE COULD NOT FIND THE INPUT TABLE OR THE QUERY 'DIALOG'.
    : : :
    : : :
    : : :
    : : :
    : : :
    : : as I was saying before, I'm not familer with the methods used outside of access to pass parameters into a qry, with the exception of the parameters collection in ado command objects - which I have never tested with access.
    : :
    : : How are you trying to pass the parameters to the qry? As you where saying, you have a qry that expects 5 parameters, and if you don't provide those param's then it will fail.
    : : [blue]
    : : C:Dos
    : : C:Dos Run
    : : Run Dos Run
    : : [/blue]
    : :
    : :*************************************************************************WELl FOR A UPDATE...
    :
    : i/ve basically been teaching myself SQL so i can try to connect. anyone out there now how to or if you can, create a sql string that searches the DB based on what is showing in labwels on a VB form?
    :
    :
    :

    [code]
    strSQL = "select * from tblName where fldValue ='" & lblValue.caption & "'"
    [/code]

    or you can use the filter and find methods of the ado REcordset object if you already have a recordset with all the data from a table to search through it

    [code]
    'assuming you already have a Recordset called objRS with all the data from the table

    objRS.Find "fldVAlue='" & lblValue.caption & "'" 'to get a single record

    or

    objRS.Filter = "fldVAlue=' & lblValue.caption & "'" ' to get multiple results IE. all products of a specific type.
    [/code]

    hope it helps
    [blue]
    C:Dos
    C:Dos Run
    Run Dos Run
    [/blue]

  • jlawren7jlawren7 Member Posts: 19
    [b][red]This message was edited by jlawren7 at 2004-4-6 7:14:55[/red][/b][hr]
    : : : : [b][red]This message was edited by jlawren7 at 2004-4-2 10:17:42[/red][/b][hr]
    : : : : [b][red]This message was edited by jlawren7 at 2004-4-2 7:44:58[/red][/b][hr]
    : : : : : : : : ok, quick summary.... vb 6.0 application. access 2000 DB with 1 table. my application need to pop up a form that(which it does now) has search criteria, run the query i created in access, and display the results on a new VB form.
    : : : : : : : : list of forms and etc...
    : : : : : : : :
    : : : : : : : : frmResults = result form using a ADODB data controller
    : : : : : : : : dialog = search criteria form. (dont know if i need to bind the text boxes to a ADO controller or not???)
    : : : : : : : :
    : : : : : : : : access query
    : : : : : : : : access form that allows me to enter search criteria and runs the query.
    : : : : : : : : these are my problems to date
    : : : : : : : :
    : : : : : : : : frmResults also has a dgdfilter datagrid
    : : : : : : : : it also hase 5 labels which display the search results from the dialog form.
    : : : : : : : :
    : : : : : : : : i also createda a form in access that does what i want to do, BUT i need to do the same in VB.
    : : : : : : : :
    : : : : : : : : how can i have my VB Dialog form when enabled, have the criteria run the query(Access), and have the query results display ed on form frmresults in VB?
    : : : : : : : : ***********************************************************************
    : : : : : : : : Please help
    : : : : : : : :
    : : : : : : : :
    : : : : : : : you can add a ADO data Control to your project and set your data grid's data source to equal your ado control, then to equal your qry results set the ado datacontrols record source property to execute your qry, then refresh it and then refresh your data grid and it will show the results of your query.
    : : : : : : : [blue]
    : : : : : : : C:Dos
    : : : : : : : C:Dos Run
    : : : : : : : Run Dos Run
    : : : : : : : [/blue]
    : : : : : : :
    : : : : : : :
    : : : : : : **********************************************************************
    : : : : : :
    : : : : : : i tried this, and i get an error of "adodbquery" <---is in the title
    : : : : : : "to few parameters:expected 5"
    : : : : : :
    : : : : : : i dont understand that statement
    : : : : : : i have a form in access that allows me to enter the search criteria, i cant seem to link that form to VB but the query if you run it in access, it has 5 input boxes asking for the search criteria
    : : : : : :
    : : : : : :
    : : : : :
    : : : : :
    : : : : : The error that you got is because your query is expecting you to pass it 5 parameters, if you use an ado control to execute a query then you need to make sure to change the type(in the record source builder) to adcmdProc instead of the adcmdText. you may need to do a search on here or google as to how to pass the parameters through the ado as I haven't tried that with access before and I'm not sure of the syntax. The only way I know for sure how to to that is with the parameters collection of the command object - as I have done that with sql server before, but if you do it that way as far as I know you would then need to keep the Recordset in your code open for as long as you wanted to view the code in the data grid.
    : : : : :
    : : : : : so I think your best bet is to do a search on passing parameters to access through vb, then you should beable to do it through a data control.
    : : : : :
    : : : : :
    : : : : : Hope this helps.
    : : : : : [blue]
    : : : : : C:Dos
    : : : : : C:Dos Run
    : : : : : Run Dos Run
    : : : : : [/blue]
    : : : : :
    : : : : :
    : : : : ***********************************************************************
    : : : :
    : : : : thats what i did as of last night. put an ADO control on my dialog form, pointed it to the query. on my results form, the datagrid filter is also pointing to the query. i get the error message when i click my button on mt main form which launches my dialog form. i also get the same message when i termionate the program. as you stated, i "C" dos run and Run he does.
    : : : :
    : : : : *********************************************************************
    : : : : this is the message i get now "the microsoft jet daTABASE ENGINE COULD NOT FIND THE INPUT TABLE OR THE QUERY 'DIALOG'.
    : : : :
    : : : :
    : : : :
    : : : :
    : : : :
    : : : as I was saying before, I'm not familer with the methods used outside of access to pass parameters into a qry, with the exception of the parameters collection in ado command objects - which I have never tested with access.
    : : :
    : : : How are you trying to pass the parameters to the qry? As you where saying, you have a qry that expects 5 parameters, and if you don't provide those param's then it will fail.
    : : : [blue]
    : : : C:Dos
    : : : C:Dos Run
    : : : Run Dos Run
    : : : [/blue]
    : : :
    : : :*************************************************************************WELl FOR A UPDATE...
    : :
    : : i/ve basically been teaching myself SQL so i can try to connect. anyone out there now how to or if you can, create a sql string that searches the DB based on what is showing in labwels on a VB form?
    : :
    : :
    : :
    :
    : [code]
    : strSQL = "select * from tblName where fldValue ='" & lblValue.caption & "'"
    : [/code]
    :
    : or you can use the filter and find methods of the ado REcordset object if you already have a recordset with all the data from a table to search through it
    :
    : [code]
    : 'assuming you already have a Recordset called objRS with all the data from the table
    :
    : objRS.Find "fldVAlue='" & lblValue.caption & "'" 'to get a single record
    :
    : or
    :
    : objRS.Filter = "fldVAlue=' & lblValue.caption & "'" ' to get multiple results IE. all products of a specific type.
    : [/code]
    :
    : hope it helps
    : [blue]
    : C:Dos
    : C:Dos Run
    : Run Dos Run
    : [/blue]
    :
    : **********************************************************************
    so let me get this right,

    create a varible named strSQl, use the above mentioned string which will get me the result on the value in a label. if so cool. say i'm searching for multiple values in different fields. e.g. Wind D, Wind S, Altitude, realitive Humidity, Air Temp <----- thease are the fields in my table. would i need to create seperate Sql varibles for all of these to search? or could i incorparate 1 Sql statement to search all. which is eaiser? i do appreciate all the help. i've had more luch using the sql statement just playing around trying to find records. do i put all this into the " Form_Load Event or does it have to go into a Click_Event? i'm trying this instead of connecting a dialog form to the DB. the values in the labels are from the dialog form that the user put in. so i thought it would be eaiser to search the db from the form that was going to display the results.



  • GideonOmegaGideonOmega Member Posts: 617

    : :
    : : [code]
    : : strSQL = "select * from tblName where fldValue ='" & lblValue.caption & "'"
    : : [/code]
    : :
    : : or you can use the filter and find methods of the ado REcordset object if you already have a recordset with all the data from a table to search through it
    : :
    : : [code]
    : : 'assuming you already have a Recordset called objRS with all the data from the table
    : :
    : : objRS.Find "fldVAlue='" & lblValue.caption & "'" 'to get a single record
    : :
    : : or
    : :
    : : objRS.Filter = "fldVAlue=' & lblValue.caption & "'" ' to get multiple results IE. all products of a specific type.
    : : [/code]
    : :
    : : hope it helps
    : : [blue]
    : : C:Dos
    : : C:Dos Run
    : : Run Dos Run
    : : [/blue]
    : :
    : : **********************************************************************
    : so let me get this right,
    :
    : create a varible named strSQl, use the above mentioned string which will get me the result on the value in a label. if so cool. say i'm searching for multiple values in different fields. e.g. Wind D, Wind S, Altitude, realitive Humidity, Air Temp <----- thease are the fields in my table. would i need to create seperate Sql varibles for all of these to search? or could i incorparate 1 Sql statement to search all. which is eaiser? i do appreciate all the help. i've had more luch using the sql statement just playing around trying to find records. do i put all this into the " Form_Load Event or does it have to go into a Click_Event? i'm trying this instead of connecting a dialog form to the DB. the values in the labels are from the dialog form that the user put in. so i thought it would be eaiser to search the db from the form that was going to display the results.
    :
    :
    :
    :


    Ok as far as where you search the DB, anywhere you want onload, onclick what ever, just remember that if you are going to use the captions from a label that the values must be there before you search... as in if the code is in the load event of the form, the captions must be set first..

    ok now for multiple values - introduce the AND statement
    [code]
    strSQL = "select * from tblName where fldValue ='" & lblValue.caption & "' AND fldValue2 ='" & lblValue2.caption & "'"
    [/code]
    now it's been awhile since I used access but I think you only have to have one WHERE statement. I also belive that you can use up to 3 AND statments in your query.

    one other option you may want to try, and I have never done this so I don't know if it will work, is you can try setting multiple values in your find and filter methods as in:
    [code]

    objRS.Find "fldVAlue='" & lblValue.caption & "',fldValue2 ='" & lblvalue2.caption'"
    [/code]

    I'm not sure if that will work, but give it a try, you might even beable to specify more fields to check against then by including AND statements.


    and finally you can build a qry in access as complicated as you need it to be and call that into your recordset as in:(if you have a query named qryOne)
    [code]
    ...
    objRS.Source ="qryOne"
    .....
    [/code]


    I hope this helps clarify some things for you, if you have any other questions let me know.
    [blue]
    C:Dos
    C:Dos Run
    Run Dos Run
    [/blue]

  • jlawren7jlawren7 Member Posts: 19
    [b][red]This message was edited by jlawren7 at 2004-4-6 17:56:34[/red][/b][hr]
    :
    : : :
    : : : [code]
    : : : strSQL = "select * from tblName where fldValue ='" & lblValue.caption & "'"
    : : : [/code]
    : : :
    : : : or you can use the filter and find methods of the ado REcordset object if you already have a recordset with all the data from a table to search through it
    : : :
    : : : [code]
    : : : 'assuming you already have a Recordset called objRS with all the data from the table
    : : :
    : : : objRS.Find "fldVAlue='" & lblValue.caption & "'" 'to get a single record
    : : :
    : : : or
    : : :
    : : : objRS.Filter = "fldVAlue=' & lblValue.caption & "'" ' to get multiple results IE. all products of a specific type.
    : : : [/code]
    : : :
    : : : hope it helps
    : : : [blue]
    : : : C:Dos
    : : : C:Dos Run
    : : : Run Dos Run
    : : : [/blue]
    : : :
    : : : **********************************************************************
    : : so let me get this right,
    : :
    : : create a varible named strSQl, use the above mentioned string which will get me the result on the value in a label. if so cool. say i'm searching for multiple values in different fields. e.g. Wind D, Wind S, Altitude, realitive Humidity, Air Temp <----- thease are the fields in my table. would i need to create seperate Sql varibles for all of these to search? or could i incorparate 1 Sql statement to search all. which is eaiser? i do appreciate all the help. i've had more luch using the sql statement just playing around trying to find records. do i put all this into the " Form_Load Event or does it have to go into a Click_Event? i'm trying this instead of connecting a dialog form to the DB. the values in the labels are from the dialog form that the user put in. so i thought it would be eaiser to search the db from the form that was going to display the results.
    : :
    : :
    : :
    : :
    :
    :
    : Ok as far as where you search the DB, anywhere you want onload, onclick what ever, just remember that if you are going to use the captions from a label that the values must be there before you search... as in if the code is in the load event of the form, the captions must be set first..
    :
    : ok now for multiple values - introduce the AND statement
    : [code]
    : strSQL = "select * from tblName where fldValue ='" & lblValue.caption & "' AND fldValue2 ='" & lblValue2.caption & "'"
    : [/code]
    : now it's been awhile since I used access but I think you only have to have one WHERE statement. I also belive that you can use up to 3 AND statments in your query.
    :
    : one other option you may want to try, and I have never done this so I don't know if it will work, is you can try setting multiple values in your find and filter methods as in:
    : [code]
    :
    : objRS.Find "fldVAlue='" & lblValue.caption & "',fldValue2 ='" & lblvalue2.caption'"
    : [/code]
    :
    : I'm not sure if that will work, but give it a try, you might even beable to specify more fields to check against then by including AND statements.
    :
    :
    : and finally you can build a qry in access as complicated as you need it to be and call that into your recordset as in:(if you have a query named qryOne)
    : [code]
    : ...
    : objRS.Source ="qryOne"
    : .....
    : [/code]
    :
    :
    : I hope this helps clarify some things for you, if you have any other questions let me know.
    : [blue]
    : C:Dos
    : C:Dos Run
    : Run Dos Run
    : [/blue]
    :
    : ******************************************************************

    this is my sql string in the Record Souce of the properties.

    SELECT * FROM RaceTrack WHERE [Air Temp] = ' " & lblTemp.value & "' AND [Wind Speed] = ' " & lblWindS.value & " ' AND [Wind Direction] = ' " & lblWindD.value & " ' AND Altitude = ' " & lblAlt.value & " ' ;

    Where you see value i did try useing Caption as well. i get a error of "Data Type mismatch in criteria expression" well you got me on that one. i do have a Query built in access but not sure on how to call it or get the search criteria to the query. E.G Dialog form or the Values in the Labels on the Results Form.



«1
Sign In or Register to comment.