Passing Calculated Control to Query

R

Ruth

I am working in an inherited Access2K database that tracks activity on
jobs.

Summary: I'm showing previous work done on a piece of equipment and
trying to append select records to a "Warranty Notes" table. Trouble
lies in getting the current work order number to show in the query and
write to the "Warranty Notes" table. Without the current Work Order
number in the record, I can't display on the "Warranty Notes" subform
tab.

Detailed info: The Jobs form has a tab where notes can be made to help
the manager determine if a repair falls within warranty. To aid in
gathering the information, I have created a button in the main form
that displays a continuous form with all previous work on this
equipment (keyed to [EUID], the unique identifier for the piece of
equipment.) Each line has a checkbox that can be checked if it
appears that work order might pertain to the current work being done.
At the bottom of the page, I have a text box (named [WOforHistory])
that captures the current WO# from Jobs form and displays it in the
footer (this works: =[Forms]![FrmJobEntry]![WOnumber]). I have written
a query that appends data from the previous WOs to a table
"WarrantyNotes." The criteria comes from the "AddtoNotes" checkbox.
The query displays the correct records but the field for WO displays
the letter "M" and a square symbol... or nothing at all. (I've tried
several different things and don't get a consistent result.) Here's
what the SQL looks like:

INSERT INTO tblWarrantyNotes ( WO, WarrNote )
SELECT [Forms]![FrmSearch2]![WOforHistory] AS WO, "Equip Loc where
repaired: " & [Location] & ", Job Desc: " & [JobDescription] & ", Date
Complete: " & [Stop] AS [Note]
FROM qrySearch2
WHERE (((qrySearch2.AddToHistory)=Yes));

As I said, the current work order number displays in the footer fine,
but the value is not passing to the query. I've also tried using the
value from the underlying Jobs form, but no luck there either. Any
other ideas on how I could pass this value into the query?

Thanks,
Ruth
 
G

Guest

Hi Ruth,

If the work order number in the footer is from
[Forms]![FrmJobEntry]![WOnumber] why not use this in your query?

Damian.
 
R

Ruth

I tried that. I can't remember if I got a blank or if the query just
didn't run. It seemed like it *should* work. I'll try that again in
the morning.

Thanks for the suggestion. I'll post back the result.

Ruth
 
R

Ruth

OK... using the field [Forms]![FrmJobEntry]![WOnumber] gives me the
result in the WO field of the square character and M (no spaces and
the M is capitalized-- this is a number field, by the way).


Hmmm... changing back to [Forms]![FrmSearch2]![WOforHistory] gives me
the square character and M. Before I changed it the first time, I ran
the query with this field referenced and got a completely blank field
result for WO number.

Ah well. I'm going to try to set it up as a parameter query and have
the user just key in the current work order number. I need to get this
version into production. But any other comments or ideas are welcome!

Ruth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top