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

  • : 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]

  • : : 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

  • : : : 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]

  • [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'.




  • : [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]

  • : : [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?


  • : : : [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]

  • [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.




  • : :
    : : [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]

  • [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.



  • you do have to use caption instead of value the problem as far as I can tell is some of your fields in your db look like they are probably numeric instead of string in which case you will need to remove the ' from your "fldValue ='" & lblValue.caption & "'"

    would look like "fldVAlue =" & lblValue.caption


    you get a data type mismatch because you are trying to pass a string to a field expecting a numeric value(no single quotes)

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

  • : you do have to use caption instead of value the problem as far as I can tell is some of your fields in your db look like they are probably numeric instead of string in which case you will need to remove the ' from your "fldValue ='" & lblValue.caption & "'"
    :
    : would look like "fldVAlue =" & lblValue.caption
    :
    :
    : you get a data type mismatch because you are trying to pass a string to a field expecting a numeric value(no single quotes)
    :
    : hope it helps.
    : [blue]
    : C:Dos
    : C:Dos Run
    : Run Dos Run
    : [/blue]
    :
    : *********************************************************************
    change the value back to caption, remove all the single quotes around the lblfield.caption portion of the Statement.

    here is a copy of the updataed one.....
    SELECT * FROM RaceTrack WHERE [Air Temp] = " & lblTemp.caption & " AND [Wind Speed] = " & lblWindS.caption & " AND [Wind Direction] = " & lblWindD.caption & " AND Altitude = " & lblAlt.caption & " ;
    could you use a example using the string i gave you?
    i still get the data mismatch
    thanks

  • : : you do have to use caption instead of value the problem as far as I can tell is some of your fields in your db look like they are probably numeric instead of string in which case you will need to remove the ' from your "fldValue ='" & lblValue.caption & "'"
    : :
    : : would look like "fldVAlue =" & lblValue.caption
    : :
    : :
    : : you get a data type mismatch because you are trying to pass a string to a field expecting a numeric value(no single quotes)
    : :
    : : hope it helps.
    : : [blue]
    : : C:Dos
    : : C:Dos Run
    : : Run Dos Run
    : : [/blue]
    : :
    : : *********************************************************************
    : change the value back to caption, remove all the single quotes around the lblfield.caption portion of the Statement.
    :
    : here is a copy of the updataed one.....
    : SELECT * FROM RaceTrack WHERE [Air Temp] = " & lblTemp.caption & " AND [Wind Speed] = " & lblWindS.caption & " AND [Wind Direction] = " & lblWindD.caption & " AND Altitude = " & lblAlt.caption & " ;
    : could you use a example using the string i gave you?
    : i still get the data mismatch
    : thanks
    :
    :
    It all depends on the fields that you have in your db, if the field is text or memo then you will need to include the ' around the value ie
    "fldValue='" & lblvalue.caption & "'" otherwise if your field is a number then you don't need the single quotes, one thing that might be causeing it is the caption returning a string whereever you use the single quotes('). try this: Val(lblValue.caption) instead of just lblValue.caption for any values that have a numeric field in the db

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

  • : : : you do have to use caption instead of value the problem as far as I can tell is some of your fields in your db look like they are probably numeric instead of string in which case you will need to remove the ' from your "fldValue ='" & lblValue.caption & "'"
    : : :
    : : : would look like "fldVAlue =" & lblValue.caption
    : : :
    : : :
    : : : you get a data type mismatch because you are trying to pass a string to a field expecting a numeric value(no single quotes)
    : : :
    : : : hope it helps.
    : : : [blue]
    : : : C:Dos
    : : : C:Dos Run
    : : : Run Dos Run
    : : : [/blue]
    : : :
    : : : *********************************************************************
    : : change the value back to caption, remove all the single quotes around the lblfield.caption portion of the Statement.
    : :
    : : here is a copy of the updataed one.....
    : : SELECT * FROM RaceTrack WHERE [Air Temp] = " & lblTemp.caption & " AND [Wind Speed] = " & lblWindS.caption & " AND [Wind Direction] = " & lblWindD.caption & " AND Altitude = " & lblAlt.caption & " ;
    : : could you use a example using the string i gave you?
    : : i still get the data mismatch
    : : thanks
    : :
    : :
    : It all depends on the fields that you have in your db, if the field is text or memo then you will need to include the ' around the value ie
    : "fldValue='" & lblvalue.caption & "'" otherwise if your field is a number then you don't need the single quotes, one thing that might be causeing it is the caption returning a string whereever you use the single quotes('). try this: Val(lblValue.caption) instead of just lblValue.caption for any values that have a numeric field in the db
    :
    : Hope it helps
    : [blue]
    : C:Dos
    : C:Dos Run
    : Run Dos Run
    : [/blue]
    :
    :
    ***********************************************************************
    i'm totally confused now... i'm at the point to where i dont know where to put anything or how to accomplish.

    this is the code i'm trying to work with... if you could help me step by step it would be great.

    this article i read explains what i'm trying to accomplish
    http://www.visualbasicforum.com/showthread.php?t=122703
    it seems that the person who wrote this is or was in the same boat as i am

    the code below...
    if you would like a copy of my project let me know...i can e-mail it to you

    'Create QueryDef "by date"
    Dim Db As Database
    Dim Qd As QueryDef
    Set Db = OpenDatabase("C:documents and settingsjimdesktopCrew Chief projectCrew chief2000.MDB")
    Set Db = DBEngine(0).OpenDatabase("C:documents and settingsjimdesktopCrew Chief projectCrew chief2000.MDB")
    Set Qd = Db.CreateQueryDef("By date") 'Create the query "By date"
    QdText = "PARAMETERS dp Short; "
    QdText = QdText & "SELECT * FROM RaceTrack WHERE [Air Temp] = 80"
    Qd.SQL = QdText
    Print Qd.SQL
    Qd.Close

    ' Create Snapshot from QueryDef
    Dim Rs As Snapshot ' Old
    Set Qd = Db.OpenQueryDef("By Date") ' Old
    Dim Rs As Recordset ' New
    Set Qd = Db.QueryDefs("By Date") ' New

    '****************
    '
    ' This would be where your user has to provide their input into qd!dp
    ' either from a listbox, inputbox, combobox etc.
    '****************
    Qd!dp = 1991 'Set the value of the dp parameter
    '****************
    '
    '
    '****************
    Set Rs = Qd.CreateSnapshot() ' Old
    Set Rs = Qd.OpenRecordset(dbOpenSnapshot) ' New
    Do Until Rs.EOF
    For i = 1 To Rs.Fields.Count - 1
    Print Rs(i); 'Display results of query
    Next
    Print
    Rs.MoveNext
    Loop
    Rs.Close
    Qd.Close
    Db.Close
    '*****************
  • : : : : you do have to use caption instead of value the problem as far as I can tell is some of your fields in your db look like they are probably numeric instead of string in which case you will need to remove the ' from your "fldValue ='" & lblValue.caption & "'"
    : : : :
    : : : : would look like "fldVAlue =" & lblValue.caption
    : : : :
    : : : :
    : : : : you get a data type mismatch because you are trying to pass a string to a field expecting a numeric value(no single quotes)
    : : : :
    : : : : hope it helps.
    : : : : [blue]
    : : : : C:Dos
    : : : : C:Dos Run
    : : : : Run Dos Run
    : : : : [/blue]
    : : : :
    : : : : *********************************************************************
    : : : change the value back to caption, remove all the single quotes around the lblfield.caption portion of the Statement.
    : : :
    : : : here is a copy of the updataed one.....
    : : : SELECT * FROM RaceTrack WHERE [Air Temp] = " & lblTemp.caption & " AND [Wind Speed] = " & lblWindS.caption & " AND [Wind Direction] = " & lblWindD.caption & " AND Altitude = " & lblAlt.caption & " ;
    : : : could you use a example using the string i gave you?
    : : : i still get the data mismatch
    : : : thanks
    : : :
    : : :
    : : It all depends on the fields that you have in your db, if the field is text or memo then you will need to include the ' around the value ie
    : : "fldValue='" & lblvalue.caption & "'" otherwise if your field is a number then you don't need the single quotes, one thing that might be causeing it is the caption returning a string whereever you use the single quotes('). try this: Val(lblValue.caption) instead of just lblValue.caption for any values that have a numeric field in the db
    : :
    : : Hope it helps
    : : [blue]
    : : C:Dos
    : : C:Dos Run
    : : Run Dos Run
    : : [/blue]
    : :
    : :
    : ***********************************************************************
    : i'm totally confused now... i'm at the point to where i dont know where to put anything or how to accomplish.
    :
    : this is the code i'm trying to work with... if you could help me step by step it would be great.
    :
    : this article i read explains what i'm trying to accomplish
    : http://www.visualbasicforum.com/showthread.php?t=122703
    : it seems that the person who wrote this is or was in the same boat as i am
    :
    : the code below...
    : if you would like a copy of my project let me know...i can e-mail it to you
    :
    : 'Create QueryDef "by date"
    : Dim Db As Database
    : Dim Qd As QueryDef
    : Set Db = OpenDatabase("C:documents and settingsjimdesktopCrew Chief projectCrew chief2000.MDB")
    : Set Db = DBEngine(0).OpenDatabase("C:documents and settingsjimdesktopCrew Chief projectCrew chief2000.MDB")
    : Set Qd = Db.CreateQueryDef("By date") 'Create the query "By date"
    : QdText = "PARAMETERS dp Short; "
    : QdText = QdText & "SELECT * FROM RaceTrack WHERE [Air Temp] = 80"
    : Qd.SQL = QdText
    : Print Qd.SQL
    : Qd.Close
    :
    : ' Create Snapshot from QueryDef
    : Dim Rs As Snapshot ' Old
    : Set Qd = Db.OpenQueryDef("By Date") ' Old
    : Dim Rs As Recordset ' New
    : Set Qd = Db.QueryDefs("By Date") ' New
    :
    : '****************
    : '
    : ' This would be where your user has to provide their input into qd!dp
    : ' either from a listbox, inputbox, combobox etc.
    : '****************
    : Qd!dp = 1991 'Set the value of the dp parameter
    : '****************
    : '
    : '
    : '****************
    : Set Rs = Qd.CreateSnapshot() ' Old
    : Set Rs = Qd.OpenRecordset(dbOpenSnapshot) ' New
    : Do Until Rs.EOF
    : For i = 1 To Rs.Fields.Count - 1
    : Print Rs(i); 'Display results of query
    : Next
    : Print
    : Rs.MoveNext
    : Loop
    : Rs.Close
    : Qd.Close
    : Db.Close
    : '*****************
    :


    I think I see the problem, I use ADO programming - that is not ADO. So what I'm going to do is tomorrow, I have off so I'm going to trow some code together to show you the basics, put up a post if possible tonight as to what the requirements are and I'll see if I can show you all the examples that you need.
    [blue]
    C:Dos
    C:Dos Run
    Run Dos Run
    [/blue]

Sign In or Register to comment.

Howdy, Stranger!

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

Categories