Field Update With VBA code (1 Viewer)

sandya

Registered User.
Local time
Today, 17:36
Joined
Oct 27, 2013
Messages
82
Items form:
ID - Brand --- Model --- Color --- Items Description
1 -- Samsung -1234 --- white ----Samsung 1234 white
2 -- Nokia -----225 ----black ----Nokia 225 black

Above Brand, Model, Color field's data is merged in Item Description field without entry & using with build formula =[Brand] & " " & [Model] & " " & [Color] so its working perfectly. But I need vba code for update the Item Description from Brand, Model and Color field's entry.

Can anyone help me how to give a vba code for this issue.

Thanks
Sandhya.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 13:06
Joined
Jul 9, 2003
Messages
16,286
what condition(s) will trigger the update?
 

pradeepiyer

New member
Local time
Today, 17:36
Joined
Dec 3, 2013
Messages
7
You wont be able to update the description field "automatically". For that, you would have to declare the field as calculated field and provide the formula (as you mentioned).

To handle this through VB code, you need to have a triggering event and upon that, you can use this code:

Code:
Me.Description.Value = Me.Brand.Value & " " & Me.Model.Value & " " & Me.Color.Value
 

sandya

Registered User.
Local time
Today, 17:36
Joined
Oct 27, 2013
Messages
82
Yes its working perfectly below code thank you so much dear :)

Code:
Me.Description.Value = Me.Brand.Value & " " & Me.Model.Value & " " & Me.Color.Value
 

Users who are viewing this thread

Top Bottom