If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > unbound textbox

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-10-12, 23:35
krishnanhemanth krishnanhemanth is offline
Registered User
 
Join Date: May 2009
Posts: 23
unbound textbox

hi every body

iam in a very bizzaire situation

i have a form called frmVENDOR invoice with a sub form frmsubVENDOR INVOICE

IN the sub form i have unbound textbox "amount" in the subform footer which sums up the amount

on the main form i have unbound textbox "total amount" which picks the value form the sub form footer textbox "amount"

i use the unbound textbox "total amount" for further calculations on a unbound text box

The above works flawlessly

the problem is ...
on the main form i have the following
taxamount.......unbound textbox
taxrate...........bound textbox

on the form current event..
if i put a code like this...
if me.taxrate.value = 0 then
me.taxamount.value = [total amount] + 500
end if

the result on the textbox is 500 even though the total amount has a value of 1000. the actual result should have been 1500.
the unbound textbox "total amount" value is taken as zero even though it has a value of 1000 in it.

after neumerous tries, what i figured out is that the values generated are correct if i put the equation on the control source
but if i try the same through an event like form current, the value generated is as shown above.. its taking the textbox value as zero...

what could be wrong

plz help

krishnanhemanth
Reply With Quote
  #2 (permalink)  
Old 01-11-12, 04:50
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
with [total amount] is expecting to find a column called that int he current recordset
try
[total amount].value
or
[total amount].text

I'd stroingly reecommend that you drop using spaces in column / table / control names. use either CamelCase or underscore
eg
TotalAmount
or
total_amount

personally I prefer to prefix control names with the control type
eg
tbTotalAmount.. but thats just my personal preference
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #3 (permalink)  
Old 01-11-12, 11:39
Missinglinq Missinglinq is offline
Registered User
 
Join Date: Jun 2005
Location: Richmond, Virginia USA
Posts: 1,702
Is me.taxrate.value really 0 ?

Are you actually entering 0 into it, or is the Default Value for the Field set as 0?

Unless one of the options above is true, if the taxrate Textbox is simply empty, it is Null, not 0.

Linq ;0)>
__________________
Hope this helps!

The Devil's in the Details!!

All posts/responses based on Access 2000/2003
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On