Problem with sub-forms and Cmd.On_Click event

  • Thread starter Cire via AccessMonster.com
  • Start date
C

Cire via AccessMonster.com

Hi all, i got a problem which i hope you guys will help me on. I created
several forms, the main form with command buttons that leads to other forms
where users can key in their conditions for queries, i.e. parameter forms

After building the SQL string using createquerydefs

i use the code:

DoCmd.OpenQuery "Requests_open_module", acViewNormal
to open the query.

all these is assigned to a command button on click event. however when i
click on the button in form view, the query result appears in a window behind
the parameter form instead of on top of it.

so i tried:
DoCmd.OpenForm "weekly_open_requests_result", acFormDS, , ,
acFormPropertySettings, acWindowNormal

where weekly_open_requests_result is a form linked to the
Requests_open_module query. And i get the same result, upon clicking, the
form appears at the back instead of on top.

finally i went to the weekly_open_requests_result form and enabled popup in
properties window and it worked! however...it doesnt have "File" which i need
as the user upon looking at the result, needs to export it to excel.

so what is wrong here? or is there any code that i can use to make the
exporting to excel automatically; i will need the form to prompt the user for
a name and directory to save to.
 
S

Stefan Hoffmann

hi,
finally i went to the weekly_open_requests_result form and enabled popup in
properties window and it worked! however...it doesnt have "File" which i need
as the user upon looking at the result, needs to export it to excel.
so what is wrong here? or is there any code that i can use to make the
exporting to excel automatically; i will need the form to prompt the user for
a name and directory to save to.
Take a look at DoCmd.TransferSpreadsheet. You can use this method to
export your data from your query to an Excel spreadsheet.


mfG
--> stefan <--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top