WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

acPreview with filter

 
   Home -> Office other -> Reports RSS
Next:  how to use vba inside a report  
Author Message
Opal

External


Since: Jul 30, 2008
Posts: 19



(Msg. 1) Posted: Fri Sep 05, 2008 1:32 pm
Post subject: acPreview with filter
Archived from groups: microsoft>public>access>reports (more info?)

This has got me stumped....maybe because its late
on a Friday, but....

Private Sub cmdViewRegisForm_Click()
On Error GoTo Err_cmdViewRegisForm_Click

Dim stDocName As String
Dim strWhere As String

stDocName = "rptKCRegis"
strWhere = "[txtKCID] = " & Me.KCID

DoCmd.OpenReport stDocName, acPreview, , strWhere

Exit_cmdViewRegisForm_Click:
Exit Sub

Err_cmdViewRegisForm_Click:
MsgBox Err.Description
Resume Exit_cmdViewRegisForm_Click
End Sub

[KCID] is the field name on my form and "txtKCID" is on my report.
However, when I click this button I get a "Enter parameter value" pop-
up for "txtKCID" and I cannot figure out why..... both fields are
numeric fields so quotations are not the issue....

Can anyone offer any insight as to why I cannot open this
report with this filter?
Back to top
Login to vote
Damon Heron

External


Since: Jul 06, 2007
Posts: 70



(Msg. 2) Posted: Fri Sep 05, 2008 2:52 pm
Post subject: Re: acPreview with filter [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

the strWhere line should be:
strWhere = "[thecontrolsource of your textbox, not its name] = " & Me.KCID

Damon

"Opal" <tmwelton.RemoveThis@hotmail.com> wrote in message
news:b778bbbb-f051-4814-9f14-bd584dda86b0@z66g2000hsc.googlegroups.com...
> This has got me stumped....maybe because its late
> on a Friday, but....
>
> Private Sub cmdViewRegisForm_Click()
> On Error GoTo Err_cmdViewRegisForm_Click
>
> Dim stDocName As String
> Dim strWhere As String
>
> stDocName = "rptKCRegis"
> strWhere = "[txtKCID] = " & Me.KCID
>
> DoCmd.OpenReport stDocName, acPreview, , strWhere
>
> Exit_cmdViewRegisForm_Click:
> Exit Sub
>
> Err_cmdViewRegisForm_Click:
> MsgBox Err.Description
> Resume Exit_cmdViewRegisForm_Click
> End Sub
>
> [KCID] is the field name on my form and "txtKCID" is on my report.
> However, when I click this button I get a "Enter parameter value" pop-
> up for "txtKCID" and I cannot figure out why..... both fields are
> numeric fields so quotations are not the issue....
>
> Can anyone offer any insight as to why I cannot open this
> report with this filter?
Back to top
Login to vote
Display posts from previous:   
       Home -> Office other -> Reports All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
 Office
  Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET