Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

get response from command button

0 views
Skip to first unread message

Bruce

unread,
Nov 21, 2007, 3:50:03 AM11/21/07
to
Hi - I am trying to run a report with the function below. I wish to open the
form 'frm_Trade_Param' to select some query filters and then run the report.

Basically I wish to get a response from this form and continue my code as
follows;

cb_A is a command button. If this is pressed the report is run.
cb_B is also a command button. If this is pressed then the macro exits and
the form is closed.

I can do this from the form directly but I don't want to hard code this into
the form because I wish to reuse for other reports. Basically this is similar
to a vb yes/no response. How can I adjust my code to do this?

Bruce

Function rpt_Trades_Complete()
DoCmd.OpenForm "frm_Trade_Param", acNormal, "", "", , acNormal

If cb_A is pressed Then
DoCmd.OpenReport "rpt_Trades_Complete", acViewNormal, "", "", acNormal
ElseIf cb_B is pressed Then
DoCmd.Close acForm, "frm_Trade_Param"
End If
End Function

Albert D. Kallal

unread,
Nov 21, 2007, 5:05:22 AM11/21/07
to
I explain in detail how to do this here:


http://www.members.shaw.ca/AlbertKallal/Dialog/Index.html


--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOO...@msn.com

0 new messages