Form -> Pull ID -> Run Query -> Run Report All in one click?

Form -> Pull ID -> Run Query -> Run Report All in one click?

Post by Vinc » Wed, 01 Oct 2003 01:25:23


Hi,

I would like to know if anyone knows a code for a button
for the following need?

I am in a Data Entry Form which is linked to a table.
I need to run a report that is based no a Query.
My problem is I would like to know a code that when I
click the button it will simply insert the current form
records TransID into a query which will open the report
that it is based on....


Recap chaos:

All records have a unique - TransID
The query is called - QEditFP
The report is called - REditFP

PLEASE and thanks again to EVERY helping professionals!!!

Vince

 
 
 

Form -> Pull ID -> Run Query -> Run Report All in one click?

Post by John Vinso » Wed, 01 Oct 2003 05:25:29

On Mon, 29 Sep 2003 09:25:23 -0700, "Vince" < XXXX@XXXXX.COM >



Two ways:

- Edit the Query and set the Criterion on the query field to

=Forms![NameOfYourForm]![TransID]

- Or, edit the Click event of the wizard-generated code to include:

Dim strSQL As String
...
strSQL = "[TransID] =" & Me![TransID]
DoCmd.OpenReport stDocName, WhereCondition:=strSQL


John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://www.yqcomputer.com/