i want to add text from two unbound text box into one field, when i write an expression for this, the result appear in the form but the field table remain empty.
Please suggest a solution.
Please suggest a solution.
.RecordSource
) to be updated then you need to bind a control to the relevant field and update the value whenever either of the two unbound controls is updated. Use the .AfterUpdate()
events for this.
Private Sub Form_Current() With Me .txtCity = Null .txtPIN = Null If .txtHomeAddress Like "* ######" Then .txtCity = Trim(Left(.txtHomeAddress, Len(.txtHomeAddress) - 6) .txtPIN = Right(.txtHomeAddress, 6) ElseIf .txtHomeAddress Like "######" Then .txtPIN = .txtHomeAddress ElseIf .txtHomeAddress > "" Then .txtCity = Trim(.txtHomeAddress) End If End With End Sub
Me.txtHomeAddre ss
appropriately.Private Sub txtCity_AfterUpdate() With Me .txtHomeAddress = Trim((.txtCity + " ") & .txtPIN) End With End Sub Private Sub txtPIN_AfterUpdate() With Me .txtHomeAddress = Trim((.txtCity + " ") & .txtPIN) End With End Sub
Comment