Link specific form data to report

spudracer

Here and there
Local time
Today, 03:06
Joined
Jul 1, 2008
Messages
199
I've done this in the past, but my mind is old.

I've got a form that I have buttons to pull reports on. I want to avoid using parameters in the query and simplify the process by having the report automatically filtered to that individual.

The form is pulling and storing it's data to a query. I've got the Last and First name fields set up with the following code:

[Forms]![tblPersonnelData]![LAST_NAME]

My only problem is, I don't remember where to go from here. I've got a macro established to open that form when the reports opened, but again my mind is fuzzy around how to set the form up.

Any help with this would be appreciated!
 
Ok, for some reason everything is in correctly (I figured it out by the way), but when I go to run the Macro which in turn runs the report, the query that it's supposed to pull from is not being supplied with any information.

I double-checked the table and the query and both come up with the information. I run the query and am prompted for a Last and First name, which I type in and it pulls up the correct information. I'm trying to skip the typing in the name part and just have that already supplied, but it doesn't want to work...:mad:

Here's a link to what I'm basically trying to do. The last box that pops up is still opening through the form, even though I have a button set up to open the report that the query is supplying information to.

http://www.techonthenet.com/access/queries/filter1.php
 
Last edited:
I would guess: Form Name is incorrect, Control Names are incorrect, or the Form is not open when the Macro is run. Are any of these true? Verify each -- if correct, post your SQL Query here.
 
I checked the all three. I've got a macro set to open the form, then open the report. It's not an SQL, just a simple (well not right now) MDB.

I've got an old database that I did it on, and I checked with that one to look at my work. I can't think of what I'm missing. I don't see any VB code, I just don't know where to go from here.
 
can you post your db here for us? (maybe even the old one too?)
 
would you mind posting your solution? i'm sure it can help others who also make stupid mistakes.... (yes, i consider myself one of those people!) LOL
 
Certainly, you were right in your post and I was quick to dismiss it. In the query, I had the wrong expression typed in. Instead of [Form]![frmPersonnelData]![LAST_NAME], I had [Form]![tblPersonnelData]![LAST_NAME].

Simple mistake that'll ruin your day.
 

Users who are viewing this thread

Back
Top Bottom