My Assistant
![]() ![]() |
|
|
May 16 2007, 10:10 AM
Post
#1
|
|
|
UtterAccess Member Posts: 20 From: Orange County, Ca |
I am using a combo box in a form to do a 'findfirst' record, which it does, but I need it to create and set a filter to that first found record so when I hit the command button to Print preview/Printout the report(s) it will only include the records that equal that chosen from the combo box. Any help would be appreciated!!!
|
|
|
|
May 16 2007, 10:11 AM
Post
#2
|
|
|
UtterAccess VIP Posts: 5,597 From: St. Louis, MO |
Set the query that the report is bound to to do your filtering
Select * From YourTable Where YourPrimaryKey = [Forms]![YourFormName]![cboYourComboBox] |
|
|
|
May 16 2007, 10:13 AM
Post
#3
|
|
|
UtterAccess VIP Posts: 9,209 From: Maryland |
Hello and Welcome to UA!!!!
Yes the Where Clause of the OpenReport Method: DoCmd.OpenReport "rptReportName", acViewPreview, , "[FieldtoFilter]=" & Me.cboComboBoxName HTH. |
|
|
|
May 16 2007, 10:24 AM
Post
#4
|
|
|
UtterAccess Member Posts: 20 From: Orange County, Ca |
I'll try these suggestions and let you know waht happens!
|
|
|
|
May 16 2007, 11:23 AM
Post
#5
|
|
|
UtterAccess Member Posts: 20 From: Orange County, Ca |
Hi dashiellx2000,
I tried your code but i didn't quick work - although I can see that it is closer. I'm sending you the cut-down version to view, if you don't mind that is. Thanks... dandrew |
|
|
|
May 16 2007, 12:45 PM
Post
#6
|
|
|
UtterAccess VIP Posts: 9,209 From: Maryland |
Hello, sorry dandrew, but I am at work and can only view databases in A97 presently. If you can wait until tonight, I'd be happy to look at it after I put my kids to bed (around 9pm Eastern US time). Or you can convert your db down or post the code that you are presently using. Are you getting an errors?
|
|
|
|
May 17 2007, 11:57 AM
Post
#7
|
|
|
UtterAccess Member Posts: 20 From: Orange County, Ca |
Hello dashiellx2000, sorry about the delay - internet problems, and of the pesky problem of work myself. I converted the file into '97 format so you can look at it. the error that I am getting is that it takes the first two characters of the field that I want filtered "po" and asks for a parameter. Any help you can give on this would be great, I've been banging my head on this issue. By the way, I am on the West coast, California. Thanks...
Attached File(s)
|
|
|
|
May 17 2007, 09:47 PM
Post
#8
|
|
|
UtterAccess VIP Posts: 9,209 From: Maryland |
Sorry for the late reply again, didn't see your response and the previous version you uploaded doesn't seem to want to work. Anyway, this following should work for you:
DoCmd.OpenReport stDocName, acViewPreview, , "[A-PurchaseInfo_PurchaseOrderNo] ='" & Me.Combo6 & "'" I have surrounded the criteria selection with single quotes to identify it as a text value to access. HTH. |
|
|
|
May 18 2007, 10:18 AM
Post
#9
|
|
|
UtterAccess Member Posts: 20 From: Orange County, Ca |
Hey dashiellx2000,
Your code really helped me to turn the corner on my problem. I ended up with with the below code, which is working great. DoCmd.OpenReport stDocName, acViewPreview, , "[A-PurchaseInfo_PurchaseOrderNo] = '" & Me![Combo6] & "'" Thanks for the hand... I may be calling on you again (if you don't mind) as I am trying to put together a tracking program. dandrew |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 21st May 2013 - 10:54 AM |