You can't assign a value to this object

  • Thread starter Thread starter John M
  • Start date Start date
J

John M

Hello,

I have an expense form where the user inputs his expenses on a subform. I
want to save 2 global variables in bound textboxes which are connected to
the parent record. These global variables are the Kilometer Rate and
Provincial Tax Rate on the day the expenses occured.

So I have 2 unbound text boxes, and 2 bound text boxes.

Me.TempKMRate = gcurKilometerRate 'Save Todays KM Rate in
unbound field
Me.TempHSTRate = gcurHSTRate 'Save Todays HST Rate in
unbound field
MsgBox "Form Open:Temp KMRate/HSTRate = " & Me.TempKMRate & " " &
Me.TempHSTRate

Me.INE_KMRate = Me.TempKMRate (***)
Me.INE_HSTRate = Me.TempHSTRate
MsgBox "Form Open: Bound Fields KMRate/HSTRate = " & Me.INE_KMRate & "
" & Me.INE_HSTRate
to this object. (***)

I have been working on this for days, literally. Please help!! Thank
you.

John








Run time error -2147352567
 
well, the error message looks like the system doesn't recognize the bound
control, or doesn't recognize it as a control. suggest you double check the
names of the controls in your code. also, where is the code running? and
where are the bound controls? if the code is running in the subform, and the
bound controls are in the main form, you need to reference the bound
controls as

Me!Parent!INE_KMRate
Me!Parent!INE_HSTRate

btw, is there a particular reason why you're using unbound controls as
"middlemen", rather than just setting the values of the bound controls
directly from the global variables?

hth
 
Back
Top