Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DAP running queries

Status
Not open for further replies.

Nixhex

Technical User
Mar 25, 2001
7
AU
I have a data access page and i need to attach a query onto that page however i can't find any help on this. I suppose that it has to be done in code however i have no idea how to do this. (using access 2000)
I need to tell the DAP that when a button is pressed to run the stored query? is this possible?

example :

DAP with a command button on it to say "on click" run the query.

am i being to vague?
 
You can select an event in the same way as you would for a Form and then in VBScript try "MSODSC.EXECUTE querystring"

Make sure that the connection string is correct though!

I've only just started with DAPs. They're bloody awkward things.
 
will give it a bash and let you know if it works.

Yea they are totally awkward things.. really they should of been released with more options however really cant yell about it.

thanks Johnnymagee for the suggestion.
 
Good afternoon,

Based on what Jonnymagee stated, I would like to know whether this problem can be solved the same way.

I have created a Data Access Page (DAP) Form. What I would like to do is, when the form is closed, the macros or queries will run. If this is a regular form, I have no problem. The VBA codes will run right away, at the "ON CLOSE" action.

I could not find any properties similar to "ON CLOSE" in the DAP designed form.

I tried to create a simple macros that will open the Data Access Page and have couple of queries behind them. However, it seems that when the DAP opens the form, the queries run right away. The queries are working fine but they provide no result because we need to input something in the DAP or save the record first.

I do appreciate of any suggestions that you can provide. I realize that DAP is not using VBA. But is it possible that, when the form closed, the queries or macros can run?

Let say the query name is Qry_AddRecordtotheDatabase. The MSODSC.EXECUTE should be something like:

MSODSC.EXECUTE Qry_AddRecordtotheDatabase? Do I need a dot or something after Execute? If I have two queries, all I have to do is to repeat the MSODSC, am I correct?

Another question is, can the MACROS be executed in the MSODSC.EXECUTE command?

Thank you again for your response. This is an outstanding community and a great place for self-education in the DAP.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top