Hello!
I have form which collects data against memebers of staff! what i would
like to do is open a report which shows only the memeber of staff which is
curently displayed!
so i have made the report there is the staffID on both the report and form
for the link i want to add a 'button' on the form which opens the report
showing only the current staff member data!
if this makes!
|
|
0
|
|
|
|
Reply
|
Utf
|
1/24/2008 11:26:01 AM |
|
here is the code i have writen
DoCmd.OpenReport ("report test"), acViewPreview, "Employee ID=" &
"me.Employee ID", , acWindowNormal
"smason" wrote:
> Hello!
>
> I have form which collects data against memebers of staff! what i would
> like to do is open a report which shows only the memeber of staff which is
> curently displayed!
>
> so i have made the report there is the staffID on both the report and form
> for the link i want to add a 'button' on the form which opens the report
> showing only the current staff member data!
>
> if this makes!
|
|
0
|
|
|
|
Reply
|
Utf
|
1/24/2008 11:37:00 AM
|
|
Just a few errors. The Filter needs to be the 4th parameter, not the 3rd. As
well, the reference to the EmployeeID on the form needs to be outside of the
quotes (otherwise it's going to be treated as a literal text string).
Finally, since you've got a space in Employee ID (not a great idea), you
need square brackets around the references to it:
DoCmd.OpenReport ("report test"), acViewPreview, , _
"[Employee ID]=" & Me.[Employee ID], , acWindowNormal
(I put the line continuation in there to avoid confusion)
That assumes that Employee ID is a numeric field. If it were text, you'd
need quotes around the value:
DoCmd.OpenReport ("report test"), acViewPreview, , _
"[Employee ID]=""" & Me.[Employee ID] & """", , acWindowNormal
(that's three double quotes in front, and four double quotes after).
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"smason" <smason@discussions.microsoft.com> wrote in message
news:546A75E9-E2AF-402B-B3A5-8B4A279F3758@microsoft.com...
> here is the code i have writen
> DoCmd.OpenReport ("report test"), acViewPreview, "Employee ID=" &
> "me.Employee ID", , acWindowNormal
>
> "smason" wrote:
>
>> Hello!
>>
>> I have form which collects data against memebers of staff! what i would
>> like to do is open a report which shows only the memeber of staff which
>> is
>> curently displayed!
>>
>> so i have made the report there is the staffID on both the report and
>> form
>> for the link i want to add a 'button' on the form which opens the report
>> showing only the current staff member data!
>>
>> if this makes!
|
|
0
|
|
|
|
Reply
|
Douglas
|
1/24/2008 12:23:16 PM
|
|
works a treat thanks
"Douglas J. Steele" wrote:
> Just a few errors. The Filter needs to be the 4th parameter, not the 3rd. As
> well, the reference to the EmployeeID on the form needs to be outside of the
> quotes (otherwise it's going to be treated as a literal text string).
> Finally, since you've got a space in Employee ID (not a great idea), you
> need square brackets around the references to it:
>
> DoCmd.OpenReport ("report test"), acViewPreview, , _
> "[Employee ID]=" & Me.[Employee ID], , acWindowNormal
>
> (I put the line continuation in there to avoid confusion)
>
> That assumes that Employee ID is a numeric field. If it were text, you'd
> need quotes around the value:
>
> DoCmd.OpenReport ("report test"), acViewPreview, , _
> "[Employee ID]=""" & Me.[Employee ID] & """", , acWindowNormal
>
> (that's three double quotes in front, and four double quotes after).
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
> "smason" <smason@discussions.microsoft.com> wrote in message
> news:546A75E9-E2AF-402B-B3A5-8B4A279F3758@microsoft.com...
> > here is the code i have writen
> > DoCmd.OpenReport ("report test"), acViewPreview, "Employee ID=" &
> > "me.Employee ID", , acWindowNormal
> >
> > "smason" wrote:
> >
> >> Hello!
> >>
> >> I have form which collects data against memebers of staff! what i would
> >> like to do is open a report which shows only the memeber of staff which
> >> is
> >> curently displayed!
> >>
> >> so i have made the report there is the staffID on both the report and
> >> form
> >> for the link i want to add a 'button' on the form which opens the report
> >> showing only the current staff member data!
> >>
> >> if this makes!
>
>
>
|
|
0
|
|
|
|
Reply
|
Utf
|
1/24/2008 2:00:03 PM
|
|
|
3 Replies
1256 Views
(page loaded in 0.199 seconds)
|