Changing Control Source

  • Thread starter Thread starter NNlogistics
  • Start date Start date
N

NNlogistics

I am using a popup form to supply some information to another form
(frmOrder). On that popup I want to use the click event on a cmd button to
change a control source for a text box. I am using

Forms!frmOrder.txtDCountofqryOrders.ControlSource =
DCount("fldCustomerName", "qryOrderbyCustomer")

Getting the usual #Name?
I think I isolated it to the left side of code. Not positive. But it works
everywhere else and looks pretty good to me.
 
To do this you need to assign the Control Source as a string, and
it needs to begin with an = sign like;

MyTextBox.ControlSource = "=DCount('fldCustomerName', 'qryOrderbyCustomer')"
 
Thanks Beetle

almost there

unfortunetly now I'm getting#ERROR#

I Changed the code to

Forms!frmOrder.txtDCountofqryOrders.ControlSource =
"=DCount('fldCustomerName', 'qryOrderbyCustomer')"
and I added
MsgBox ("Test " & DCount("fldCustomerName", "qryOrderbyCustomer"))
and get what I want "9"
 
Back
Top