dbTalk Databases Forums  

updating a combo box value

comp.databases.ms-access comp.databases.ms-access


Discuss updating a combo box value in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
sparks
 
Posts: n/a

Default updating a combo box value - 09-08-2010 , 09:23 AM






I have a combo box that its value is used to calc another value on the
form.

works fine until someone wiped the value from the box and hits tab.
if the drop down showed a value such as 50 and the calculations are
done on that value.
if they wipe it and exit the box the calculations are still done on
the 50 on after update.

any way to get the timing correct with this type of thing so that when
they remove the 50 and exit it is now a null and no calcuations are
done?

Reply With Quote
  #2  
Old   
Salad
 
Posts: n/a

Default Re: updating a combo box value - 09-08-2010 , 09:34 AM






sparks wrote:

Quote:
I have a combo box that its value is used to calc another value on the
form.

works fine until someone wiped the value from the box and hits tab.
if the drop down showed a value such as 50 and the calculations are
done on that value.
if they wipe it and exit the box the calculations are still done on
the 50 on after update.

any way to get the timing correct with this type of thing so that when
they remove the 50 and exit it is now a null and no calcuations are
done?

In the AfterUpdate event of the combo something like
Me.CalcField = Me.SomeField * NZ(Me.ComboFld,0)

Reply With Quote
  #3  
Old   
sparks
 
Posts: n/a

Default Re: updating a combo box value - 09-08-2010 , 01:44 PM



after update

If (Me!FullVal.Column(1) = 20) Then Me.Final = (.335 X 20)

the problem is you put in debug.print Me!FullVal.Column(1)
pick the 20 and debug.print shows 20 on afterudate

remove the 20 and leave and it will debug.pring 20 again even though
the value was cleared.
I am not sure if the value is actually recorded at a later time or
what.

I need to run and try on exit or lost focus

On Wed, 08 Sep 2010 07:34:52 -0700, Salad <salad (AT) oilandvinegar (DOT) com>
wrote:

Quote:
sparks wrote:

I have a combo box that its value is used to calc another value on the
form.

works fine until someone wiped the value from the box and hits tab.
if the drop down showed a value such as 50 and the calculations are
done on that value.
if they wipe it and exit the box the calculations are still done on
the 50 on after update.

any way to get the timing correct with this type of thing so that when
they remove the 50 and exit it is now a null and no calcuations are
done?

In the AfterUpdate event of the combo something like
Me.CalcField = Me.SomeField * NZ(Me.ComboFld,0)

Reply With Quote
  #4  
Old   
Salad
 
Posts: n/a

Default Re: updating a combo box value - 09-08-2010 , 02:15 PM



sparks wrote:

Quote:
after update

If (Me!FullVal.Column(1) = 20) Then Me.Final = (.335 X 20)

the problem is you put in debug.print Me!FullVal.Column(1)
pick the 20 and debug.print shows 20 on afterudate
Why aren't you checking to see if the combo is null is well? Ex:

MsgBox IIf(Not IsNull(Me.Combo1) And Me.Combo1.Column(1) = 1, "OK", "Not
OK")

Quote:
remove the 20 and leave and it will debug.pring 20 again even though
the value was cleared.
I am not sure if the value is actually recorded at a later time or
what.

I need to run and try on exit or lost focus

On Wed, 08 Sep 2010 07:34:52 -0700, Salad <salad (AT) oilandvinegar (DOT) com
wrote:


sparks wrote:


I have a combo box that its value is used to calc another value on the
form.

works fine until someone wiped the value from the box and hits tab.
if the drop down showed a value such as 50 and the calculations are
done on that value.
if they wipe it and exit the box the calculations are still done on
the 50 on after update.

any way to get the timing correct with this type of thing so that when
they remove the 50 and exit it is now a null and no calcuations are
done?


In the AfterUpdate event of the combo something like
Me.CalcField = Me.SomeField * NZ(Me.ComboFld,0)

Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.