Make two fields interdependant

ppataki

Registered User.
Local time
Today, 11:31
Joined
Sep 5, 2008
Messages
267
Dear All,

I have a form where I have two fields that I need to behave in a way that if one of them is changed then the other needs to be changed as well and vice versa.

eg. I have a date and a text field, if the date gets updated, the text should also be updated otherwise user cannot progress to next record and vice versa, if text is updated, the date field must be changed as well in order to be able to progress to the next record

Many thanks in advance! ;)
 
Be careful you do not get yourself in a circular reference. Use the after update of each control to update the opposite field.
 
Hi DCrake,

Could you be more specific please?

Many thanks
 
Ok

you have two fields (TxtFldA and TxtFldB)

Go to the AfterUpdate event of TxtFldA and code

Code:
If Me.TxtFldA = "Whatever you decide" Then
   Me.TxtFldB = "Whatever you want"
End If

Reapeat the above for the TxtFldB control.
 
The problem is that I dont know what the "whatever you decide" will be
As it is a text field, users can write there anything

So the point is that whenever TxtFldA is changed to whatever, user needs to fill in TxtFldB as well (so focus remains on that field until updated)
and vice versa

Thank you very much for your help
 
Not knowing the details of your form design, this suggestion may not be appropriate, but I would handle this by checking that the field is populated when the user goes to save the record or close the form.

Forcing a user to enter a specific piece of information at a precise point in the process may come back to bite you later. -If some circumstance arises where the information isn't immediately available (if, for example, the person defining the information is busy on a call, or somethign like that), but will be available before the form is closed

Forcing the user to fill it in before they finish dealing with the record should be able to achieve the same end result, with a little more flexibility to deal with cases where the field maybe can't be filled in right at that moment.
 
Could you please precise how I can do that?
(for me it is not the point to force them entering data right at that moment, but before closing the given record)

Thank you
 
At the moment, how is the data being entered? Is it via a form? If so, what happens when the user has completed a record and wishes to move to the next one?
 
It is happening via a form, they are free to surf the records
So I would like that if they change the content of Field1 then they also would be forced to change Field2 before moving to the next record

Thank you
 

Users who are viewing this thread

Back
Top Bottom