Report Opening

Beany

Registered User.
Local time
Today, 12:52
Joined
Nov 12, 2006
Messages
155
Hi,

im struggling to bring a report above a form.

there is a combobox in the form, from where i select a username and bring his details up in a report(Report2).............

ive got the following code for the OnOpen event:

PHP:
Call DoCmd.SelectObject(ObjectType:=acReport, ObjectName:=Me.Name)


my report is called Report2.............

(Report 2 = includes details of all users)

but from the combobox, i select a username and it brings up ONLY his/her details.......

how do i implement this into my database? what do i change?


im using the following code for the combobox afterUpdate:

PHP:
Private Sub Combo0_AfterUpdate()
DoCmd.OpenReport "Report2", acPreview, "", "[userID]=[Forms]![comboreport]![Combo0]"


End Sub

im confused........
 
I would think that you would need to change the code on your report.
Since your report is already coded you need to change it to accept a value from your combobox.

So say something Like
If combobox.name = null
THen print all
else if
combobox.name = name1
then print name1

Not quite the code you would use but something along those lines.

Or do something like I did for my report here http://www.access-programmers.co.uk/forums/showthread.php?t=119233

Look at how I linked the form and report.

That might help you out.
 
thanks for ur reply.......

everything in my database works............

apart from the way the report pops up!?? i want it to come above all windows (including the form window from which i opened the report)?????


:confused: :confused:
 

Users who are viewing this thread

Back
Top Bottom