Reference field in combo box value

H

HilcrRWise

I have a combo box that has various statements that when selected cop
on to the end of the value in a memo field. What I want to be able t
do is to reference a different field on a form in one of thes
statements. Eg: a statement in the combo box says something lik
"<<FORENAME>> has worked very hard this year." when this statement i
selected the database should look to see what value is currently bein
shown in the Forename field and the value copied to the memo fiel
should read "Bob has worked...". The 'FORENAME' reference does no
always come at the start or the end of the statement.

Is this possible?

I tried using the replace function on the after update option of th
combo box
Replace([Comment],"<<FORENAME>>",[ForeName])
but kept getting 'Compile Error: Expected: =
 
Y

yakule

Replace is a function so it returns a value. You need to give it a
variable to return the value to. So basically you need to do something
like this:


Code:
 
B

Bill

MemoFieldName = EmployeeFieldName & ComboBoxName.
If you need to place the name into the statement vs beginning or end then
set up the combo box with three columns, the first one containing the Psuedo
phrase, the second column the beginning of the sentence and the third with
the end of the sentence. Now code it like so:
MemoFieldName = ComboBoxName.Column(1) & EmployeeFieldName &
ComboBoxName.Column(2)
THT
Bill
 

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