Verify value overwrite in Auto Filled fields

G

Guest

I have several fields on my form that are auto populated by selections made
from a combo box. One of these fields is a phone number field.

A user MAY enter data into the phone number field BEFORE selecting the
corresponding info from the combo box. Once they select the info from the
combo box the value they entered in the phone number field is overwritten
with that which is auto popluated from the combo box.

Is there a way to prompt user if they want to overwrite value in the phone
number field???

This form is used for our tech service department to log service calls. The
majority of the time they will want to use the phone number that is
autofilled, but occasionally they want to use the one they manually entered.
 
D

Douglas J. Steele

Instead of

Me.txtPhone = Me.cboCustomer.Column(3)

use something like

If Len(Me.txtPhone & vbNullString) > 0 Then
If Me.txtPhone <> Me.cboCustomer.Column(3) Then
If MsgBox("Do you want to overwrite the phone number?") = vbYes Then
Me.txtPhone = Me.cboCustomer.Column(3)
End If
End If
Else
Me.txtPhone = Me.cboCustomer.Column(3)
End If
 

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