Control Source property

D

davidjurban

is it not possible to populate a text box using both Control Sourc
property and using a DLookUp triggered by an event? I used the Contro
Source method to originally populate the text box then attempted to ad
code to repopulate the text box upon change of another field. Thi
method produces a run time error... '-2147352567 (800200009)' Yo
can't assign a value to this object.

Sooooo...if there is a conflict using the Control Source property...ho
do I populate the fields in each record initially? Can I assign th
expression to an event that is associated with the creation of eac
record in the database?
 
D

davidjurban

Used Control Source with expression....

= DLookup("[fax]", "[service agent]", "[service agent] =
Forms![service call]![service agent]")

to populate the field. Then used the following expression in th
Change event to repopulate after the record has been displayed an
changed. This is the code which is being flagged by the erro
message..."can't set value"...

[Form_service call].service_agent_fax = DLookup("[fax]", "[servic
agent]", "[service agent] = Forms![service call]![service agent]"
 
D

davidjurban

Thanx. I believe I have worked it out. I took the expression out o
the Control Source property and imbedded it in the Form Current even
of the Form properties. The form now updates the fields in questio
upon displaying a new record and after a change to the record. Ther
is an example in Access help under Programming Information/Working wit
events/Using Event procdures to work with forms/ ..
 

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