Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / May 2007

Tip: Looking for answers? Try searching our database.

Getting a report to Filter

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bob V - 26 May 2007 03:04 GMT
On my Form I have a Print Preview Control
My Form / has a Text Box  [tbHorseID] Control Source [HorseID]

My Report/ rptHorseInfoOwner Control Source is a query that has Field
[qHorseNameSourceAddMode.HorseID]

Print Preview Button, On Click:
DoCmd.OpenReport "rptHorseInfoOwner", acViewPreview, , "HorseID = " &
HorseID '****Yellow*****

I am trying to get the Report to Filter HorseID in Form to HorseID in the
query
Thankful if anyone can help.....Bob
Bob V - 26 May 2007 03:09 GMT
> On my Form I have a Print Preview Control
> My Form / has a Text Box  [tbHorseID] Control Source [HorseID]
[quoted text clipped - 9 lines]
> query
> Thankful if anyone can help.....Bob
Oops Sorry my Report has the text box on it
[qHorseNameSourceAddMode.HorseID]
Thanks Bob
Larry Linson - 26 May 2007 05:19 GMT
Try

DoCmd.OpenReport "rptHorseInfoOwner", acViewPreview, , "HorseID = " &
Me!HorseID '****Yellow*****

If that doesn't work, change the name of the Text Box displaying the Field
HorseID to "txtHorseID" and try

DoCmd.OpenReport "rptHorseInfoOwner", acViewPreview, , "HorseID = " &
Me!txtHorseID '****Yellow*****

If "HorseID" is a Text Field, rather than a Number Field, you'll need to add
some punctuation.

Larry Linson
Microsoft Access MVP

>> On my Form I have a Print Preview Control
>> My Form / has a Text Box  [tbHorseID] Control Source [HorseID]
[quoted text clipped - 12 lines]
> [qHorseNameSourceAddMode.HorseID]
> Thanks Bob
Bob V - 26 May 2007 06:15 GMT
Thanks Larry I copied the Name text box and hid it on my form seems to be
working fine.....Thanx Bob
Private Sub Command682_Click()
On Error GoTo Err_Command12_Click
   Dim stDocName As String

   DoCmd.OpenReport "HorseInfoOwner", acViewPreview, ,
"[Name]=Forms!frmHorseInfo!Name"

Exit_Command12_Click:
   Exit Sub

Err_Command12_Click:
   MsgBox Err.Description
   Resume Exit_Command12_Click
End Sub

> Try
>
[quoted text clipped - 29 lines]
>> [qHorseNameSourceAddMode.HorseID]
>> Thanks Bob
Larry Linson - 26 May 2007 08:40 GMT
A word of caution: Name is not a good name for a Field; it is an Access
reserved word, the name of a property of many objects, including Tables,
Queries, and Fields.  Using reserved words can, at best, be confusing; at
worst, you can have errors that may be difficult to debug.

Larry Linson
Microsoft Access MVP

> Thanks Larry I copied the Name text box and hid it on my form seems to be
> working fine.....Thanx Bob
[quoted text clipped - 46 lines]
>>> [qHorseNameSourceAddMode.HorseID]
>>> Thanks Bob
Bob V - 26 May 2007 08:48 GMT
Thanks Larry, I will change it to HorseName?...Regards Bob

>A word of caution: Name is not a good name for a Field; it is an Access
>reserved word, the name of a property of many objects, including Tables,
[quoted text clipped - 54 lines]
>>>> [qHorseNameSourceAddMode.HorseID]
>>>> Thanks Bob
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.