[AccessD] Getting query fields into a report [WAS: Try this oneagain]

John Clark John.Clark at niagaracounty.com
Tue Dec 22 08:27:17 CST 2009


OK...This is getting flippin' weird!!! After writing this, I decided to change up slightly, and instead of relying on combining the first and last names, in the query, I decided to do it, right in the report itself. I added the code, "P1 = [txtWitFName] & " " & [txtWitLName]" at the top, and this worked perfectly. So, I went ahead w/the code for the 2nd paragraph, and when I finished and tested it, the code errs out on the original paragraph and says, "Microsoft Office Access can't find the field 'txtWitFName' referred to in your expression." Are you kidding?! It just found it a moment ago!!!
 
It is a conspiracy I tell you...someone is screwing w/me. They are jealous that I still have my hair and that it is not grey...and they are trying to get me to rip it out...and they're doing a bang up job this morning, I tell you!

>>> "John Clark" <John.Clark at niagaracounty.com> 12/22/2009 9:11 AM >>>
To clarify this problem a bit...I was a little flustered this morning, and doing too many things at once...I can call a "basic" field, but for some reason, I am unable to call a "created" field. What I mean is, if I call "txtWitLName" I get the witness' last name w/no problem, however what I've done in the query, is to combine the last name and first name, into a single field

Witness: [txtWitFName] & " " & [txtWitLName]

for some reason it doesn't like this, and I always thought these fields were really no different than the others.

I also have to convert the number fields into text...this thing was suppose to be a quickie!

>>> "John Clark" <John.Clark at niagaracounty.com> 12/22/2009 8:45 AM >>>
OK, I am taking your advice, and I've started doing this. I'm finding that isn't all that bad, and I think it will look alright. The trouble I am now having though, is that I am unable to bring the data into the paragraph. In the code, for the OnLoad event of the form, I am doing this:

Dim P1, P2, P3 As String

P1 = Witness
P1 = P1 + " - Being duly sworn, says that he/she attended as a witness on behalf of the People "
P1 = P1 + "before the above court, pursuant to a subpoena or at the request of the District "
P1 = P1 + "Attorney and that he traveled from the City/Town/Village of "
P1 = P1 + txtWitCity
P1 = P1 + ", in the State of New York, which said place is "
P1 = P1 + numMileage
P1 = P1 + " miles from the Court House in the City of Lockport."

Me.lblParaOne.Caption = P1


I've tried other things, but what is the code for getting a field (Witness, txtWitCity, numMileage) out of the query? I don't need to do this the "long" way do I?

>>> "Reuben Cummings" <accessd at gfconsultants.com> 12/21/2009 11:44 AM >>>
I would stick with Access reports.  I make all kinds of reports for
government work all using Access.  And if the formatting is tough to copy
you'd be surprised what you can convince people to change to.
I've nearly changed the culture of "claims" in the state of Indiana.  The
old form was ridiculous - and I couldn't match it.  So I convinced one
county to change years ago and now it's on the verge of being the standard.

And if you are placing parts of your data into pre-worded paragraphs (the
paragraph wording is pre-defined other than your data) do all the paragraph
building in code.   

Reuben Cummings
GFC, LLC
812.523.1017
-- 
AccessD mailing list
AccessD at databaseadvisors.com 
http://databaseadvisors.com/mailman/listinfo/accessd 
Website: http://www.databaseadvisors.com 
-- 
AccessD mailing list
AccessD at databaseadvisors.com 
http://databaseadvisors.com/mailman/listinfo/accessd 
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list