add value in a work field

vagelisr

Registered User.
Local time
Tomorrow, 01:07
Joined
Apr 28, 2011
Messages
87
Hi to all.

I have in my table a field called 15_17_flag
This field take only 2 values. "15" and "17"
I want if the field has value 15 to show in the form in a work field "Value 15"
if has the value 17 show in the form in the same work field "Value 17"

How can i do this.

Thanks and regards.
 
If the form control name is WorkField then

Code:
Me.WorkField = "Value " & Me.[15_17_flag]

I recommend you remove all spaces & underscores in your field names.
Better would be Flag1517 or FlagValue
If so, [] are no longer needed

Code:
Me.WorkField = "Value " & Me.FlagValue
 
Thanks for your answer ridders

Can you please help me do this in a query???

If also you can send me an example it will be great.

To me more precisely is the flag has value 15 then i want the work field take the value Best Before if has the value 17 the work field take the value Expiration Date

Thanks!!!!
 
I wouldn't use a query
Easier to do this in the form design

Attached is a very simple example of what I believe you want.
Adapt as necessary
 

Attachments

Another huge favor.

Can you send the file for office 2003?????
 
First of all ridders i really appreciate all your help

The point is : my form is (I use Greek Office) table and they will have a lot of records.
How can i do this.

PS:Look in my access where i want them.
 

Attachments

Sorry but I've no idea what you mean
You've just reposted my example db with a few more records
 
And with a new screen.
A wand to do the same in my new screen!!!!!
 
there is an easy way without
coding.

show your table in Design view.
on FlagValue field, put this
as Format to the field:

"Value "0;"Value -"0

bring your from in Design
view. Put same Format to the
FlagValue.
 
Thank you arnelgp for your time.

Can you make this in the access i have already upload??

Thanks and regards.
 
Create a Query with
from Table1 and use
the Query as RecordSource
of the Form.

See Query1.
 

Attachments

Thanks again for your time arnelgp.
Finally i did what i wand and i forget to inform the forum.
The problem is with the iif in the query.
Because the office is in Greek Language i have to use ; instead of ,

PS: Also ofcouse your example work like a charm......

Thanks and regards...
 

Users who are viewing this thread

Back
Top Bottom