Function In Column Header

  • Thread starter Thread starter Jason Silva
  • Start date Start date
J

Jason Silva

Hello,

I would like to put a function in the column header of a query. I don't mean to calculate the value, I mean just the header itself. In other words I would like the column header to read:

Loan Balance As Of <NOW()>.

Can this be done? This query will feed a report so maybe it's easier just to wait until then?

Thanks,
 
I can't think of any way of doing it in a query, but it would be simple to
do in the report ...

Private Sub Report_Open(Cancel As Integer)

Me.lblTest.Caption = "Loan balance as of " & Now()

End Sub

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.


Hello,

I would like to put a function in the column header of a query. I don't
mean to calculate the value, I mean just the header itself. In other words
I would like the column header to read:

Loan Balance As Of <NOW()>.

Can this be done? This query will feed a report so maybe it's easier just
to wait until then?

Thanks,
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


You'd have to use VBA to create the query. E.g.(using DAO):

dim strSQL as string

strSQL = "SELECT column_name As [Loan Balance As Of " & Now() & "] " & _
"FROM table_name"

' Put the SQL into a QueryDef
CurrentDB.QueryDefs("query_name").SQL = strSQL

' Open the query
DoCmd.OpenQuery "query_name"

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQfbPY4echKqOuFEgEQLo+QCfQYJfvLd2xJHIAxTdT18aQ7OFbd0AoKPn
WYVl4Fc+fIg2ZBcbsurzry+V
=Q1b7
-----END PGP SIGNATURE-----
 
Thank you MG and Brenda.

--
Jason Silva
York County FCU
IT Manager
BS-IT Student - UOP
MGFoster said:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


You'd have to use VBA to create the query. E.g.(using DAO):

dim strSQL as string

strSQL = "SELECT column_name As [Loan Balance As Of " & Now() & "] " & _
"FROM table_name"

' Put the SQL into a QueryDef
CurrentDB.QueryDefs("query_name").SQL = strSQL

' Open the query
DoCmd.OpenQuery "query_name"

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQfbPY4echKqOuFEgEQLo+QCfQYJfvLd2xJHIAxTdT18aQ7OFbd0AoKPn
WYVl4Fc+fIg2ZBcbsurzry+V
=Q1b7
-----END PGP SIGNATURE-----


Jason said:
Hello,

I would like to put a function in the column header of a query. I don't
mean to calculate the value, I mean just the header itself. In other
words I would like the column header to read:

Loan Balance As Of <NOW()>.

Can this be done? This query will feed a report so maybe it's easier
just to wait until then?

Thanks,
 
Back
Top