Link to home
Start Free TrialLog in
Avatar of Wade Knox
Wade KnoxFlag for United States of America

asked on

How to approach setting owner and assigned to field to Administrator with one button click?

See provided Pic:

I have a form with company info in it and a subform with that companies contacts - I wish to select a contact and then set the Assigned To and the Owner fields to Administrator with one easy click - can someone help me solve this?

I was thinking of using a different form for this particular function but im not sure if there is an easier way using this existing form?

Thanks in advance.

 User generated image
Avatar of pteranodon72
pteranodon72
Flag of United States of America image

Open subform in design view. In the "Assigned To" textbox (I don't know its name) add a OnDoubleClick event. In the code attached to that event, add

txtAssigned_To = "Administrator"
txtOwner = "Administrator"

(but use the real textbox names).

Double-click is a good event for a change like this. Single-clicking a field is not enough- you'll click it while just reading the info.

If this kind of change is not appropriate everywhere the subform is used, you should create a separate subform.

HTH,
pT72
Avatar of Wade Knox

ASKER

heres what i have

Private Sub AssignedTo_DblClick(Cancel As Integer)
txtAssignedTo = "Administrator"
txtOwner = "Administrator"
End Sub

but when i load the form and double click the assignedto or the owner field - nothing happens!
or it only highlights the value in the field. and it doesnt change the value to administrator.
ASKER CERTIFIED SOLUTION
Avatar of pteranodon72
pteranodon72
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
this works! Thanks