Is it possible to amend a field that is created from 2 other fields?

ablettablet

New member
Local time
Today, 16:42
Joined
Jan 5, 2012
Messages
9
Hi

I'm in the middle of creating a new database that will assist in the running of our company. I have a form for adding new products, one of my fields is a concatenate of 2 other fields within the same form this works brilliantly picking up the invoice description from a product name field and a product description (these 2 fields are used for marketing and advertising purposes) ..... however when it comes to our invoice we don't always want some of the description that we've used for advertising our product to be shown ...... I've noticed that I can't amend the invoice description field (the concatenated field). Is there anything I can do to format this field so that it will concatenate in the majority of cases but allow us to amend when necessary.

I hope I've explained that clearly enough, if not let me know. Any help I can get will be greatly appreciated.

Thanks.

V
 
Could you please provide sample data for all cases?
 
The problem is, I expect, that you're doing the Concatenation in the Control Source Property of the Textbox, which prevents editing.

The trick is to move it to the AfterUpdate event of the two Controls that hold the two pieces of the third Control. So, instead of using

=[Control1] & " " & [Control2]

in the Control Source of Control3, use
Code:
Private Sub Control1_AfterUpdate()
 Me.Control3 = Nz(Me.Control1) & Nz(Me.Control2)
End Sub
Code:
Private Sub Control2_AfterUpdate()
 Me.Control3 = Nz(Me.Control1) & Nz(Me.Control2)
End Sub

BTW, These kind of Fields are considered to be Calculated Fields and one of the few times when these Fields should be Bound and stored in the underlying Table is in a case like this, when they usually are but not always Calculated, like this.

Linq ;0)>
 
Last edited:

Users who are viewing this thread

Back
Top Bottom