PDA

View Full Version : give textbox a control source w/VBA



Trevor
01-31-2008, 09:48 AM
I am trying to give text1(textbox) a control source on click and it's isn't working for me, here what I have onclick;
Me.text1.controlsource = "ContactIDNum"

(contactIDNum is the name of the column in the table for the controle source the table is "ABC-XYZ"
The form already has a controlsource of that table.

rconverse
01-31-2008, 11:20 AM
What exactly are you trying to do? Do you want the value in field contactIDNum to appear in your text box?

Trevor
01-31-2008, 04:06 PM
What i have Is a Form to manage outgoing mail requests and if the origina request is from a call or Email the ref # for the Call or email goes in the appropriate box, but for reporting purposes the call and email IDnumbers and have same controlsource.
so when I query and say it happens to be an email IDNumber because both Email and call ID have the same controle source bothe call ID and Email ID populate with that # and I only want the apropriate box to populate on a query not both.
I am looking at doing an update query as a work around but that would mean duplicating info in my table by adding a callreffID for call and MailRefID for Email requests (hidden) and based upon which field is filld in in the log form it would update the EmailrefID field in the Table if it was an email entered or enter into the callRefID field if it's a call then i would just need so set the controle source on the 2 Email number and call fields to the appropieate hidden fields in the table but my update query doesn't seem to work either.
What I am tryin to do with the update query is update table "VMSU-MLT" field CallRefID with value of [Call Number] . (Me.IDNumber is the Reference for the mail log itself.+

strsql = "UPDATE VMSU-MLT SET VMSU-MLT.CallRefNum = " & Me.[Call Number] & _
"Where VMSU-MLT.IDNumber = " & Me.IDNumber