Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get variable from table stored string 1

Status
Not open for further replies.

georgesOne

Technical User
Jul 2, 2004
176
JP
Hi,

I have an application with many messages and I would like to store them in a table and call them via a lookup. Some of them contain variables.
So, when I code
sString = "Table " & UCase(Forms!frmTopic.cboTopic) & " is up."
Msgbox sString
it will result in the message

Table Toy is up.

However, if I put it into the table a pull it via the lookup function the resulting message is

Table " & UCase(Forms!frmTopic.cboTopic) & " is up.

How can/should I handle this correctly?
Many thanks in advance, Georges
 
Hi George,

From your code, this isn't possible.

After populating the table - look at the table content itself - it will probably contain what you intend.

What is your lookup 'function'?

ATB

Darrylle

Never argue with an idiot, he'll bring you down to his level - then beat you with experience.
 
You may try to play with the Eval function.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks Darrylles and PH,

some great help...

Darrylles, my lookup 'function' is
(DLookup("[MailSubject]", "ztbl_MailSubjects", "SubjectID = " & 5)
and the string is of course the MailSubject in ztbl_Mailsubjects with an record index 5.

I have also tried the Eval function and it works well if I use the table entry
"Table " & UCase(Forms!frmTopic.cboTopic) & " is up.".
So that is what I wanted. Thanks a lot.
However, is there an shorter/faster way than to use a lookup function, if I know the record index?

Thanks again.
Always wondering how you guys have all these details available...
Regards, Georges
 
...also wondering: how do professionals provide messages? Is there a better way than storing those strings in tables?
Thanks, Georges
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top