Full Version: Field Use - In query but not on form
UtterAccess Discussion Forums > Microsoft® Access > Access Reports
dbasile
Hello,

I have a query that uses some OLD data that needs to be cleaned up for a report. My report is based of a query that contains this data like BillToCustomerName, Address, Contact. I want to trim spaces, convert some of the fields to proper case and clean up some for display purposes.

If I don't put a field from the query on the form how can I use it in code behind the form. I've tried things like strTemp= Me![CustomerBillToName] but then I get error that Access can't find that field.

Do I have to put it on the form and then hide it or is there another way. This is just a quick fix until we can port all the data over and fix it once and for all.

Thanks.
David
khaos
I would just put it on the form and hide it using the visible property, especiially since it's just a temp solution. That works rather well for something like your situation and in the case where you need to show a name but still might need the ID field tied to that name.

HTH
Ken
dbasile
Thanks that just might have to do but do you know how to do it just for future reference?

Thanks again.
David
khaos
If you need it and it's in the query this is the best solution. This works best because it takes no extra time to return the fields since they are part of the form's source. If it's not in the query you could return it via a recordset.

HTH
Ken
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.