PC Review


Reply
Thread Tools Rate Thread

current value plus another one

 
 
=?Utf-8?B?YmlsbA==?=
Guest
Posts: n/a
 
      10th Dec 2006
hi
there is a number(data type) field and another number field in a subform.
all i want is every time i type a number into the second field (the subform
field ), the first field to get updated , its current value plus that
number.is that possible?

 
Reply With Quote
 
 
 
 
=?Utf-8?B?RGFuaWVs?=
Guest
Posts: n/a
 
      10th Dec 2006
try using the afterupdate event of the first field and add the following code

me.[Name of First Field] =me.[Name of Second Field] +me.[Name of First Field]

Daniel



"bill" wrote:

> hi
> there is a number(data type) field and another number field in a subform.
> all i want is every time i type a number into the second field (the subform
> field ), the first field to get updated , its current value plus that
> number.is that possible?
>

 
Reply With Quote
 
=?Utf-8?B?YmlsbA==?=
Guest
Posts: n/a
 
      10th Dec 2006
well i tried that code but unfortunatly i didnt watch any action.
then i tried of me.[Name of First Field] =me.SubFormname.Form![Name of
Second Field] +me.[Name of First Field]
but still nothing.

if u think something else Daniel pls let me know.
Thanks
"Daniel" wrote:

> try using the afterupdate event of the first field and add the following code
>
> me.[Name of First Field] =me.[Name of Second Field] +me.[Name of First Field]
>
> Daniel
>
>
>
> "bill" wrote:
>
> > hi
> > there is a number(data type) field and another number field in a subform.
> > all i want is every time i type a number into the second field (the subform
> > field ), the first field to get updated , its current value plus that
> > number.is that possible?
> >

 
Reply With Quote
 
=?Utf-8?B?RGFuaWVs?=
Guest
Posts: n/a
 
      10th Dec 2006
1- It will only get triggered after you set the focus onto another field.

2- Depending on how everything is setup you may need to use a function such
as ...=clng(me.SubFormname.Form![Name of Second Field]) + clng(me.[Name of
First Field]) to ensure that they are processed numerically. For more info
check 'Type Conversion Functions' in the help menu.

Daniel






"bill" wrote:

> well i tried that code but unfortunatly i didnt watch any action.
> then i tried of me.[Name of First Field] =me.SubFormname.Form![Name of
> Second Field] +me.[Name of First Field]
> but still nothing.
>
> if u think something else Daniel pls let me know.
> Thanks
> "Daniel" wrote:
>
> > try using the afterupdate event of the first field and add the following code
> >
> > me.[Name of First Field] =me.[Name of Second Field] +me.[Name of First Field]
> >
> > Daniel
> >
> >
> >
> > "bill" wrote:
> >
> > > hi
> > > there is a number(data type) field and another number field in a subform.
> > > all i want is every time i type a number into the second field (the subform
> > > field ), the first field to get updated , its current value plus that
> > > number.is that possible?
> > >

 
Reply With Quote
 
=?Utf-8?B?RGFuaWVs?=
Guest
Posts: n/a
 
      10th Dec 2006
Bill,

I made a small mockup to test. the form has 2 text boxes (txtValue1 &
txtValue2). Also, I ensured that both text boxes where set as 'General
Number' format mode in the properties. Then I coded the following

Private Sub txtValue1_AfterUpdate()
Me.txtValue1 = Me.txtValue1 + Me.txtValue2
End Sub

and it works fine. Whenever I make a change in value an move my mouse to
the second text box the first one's value is adjusted appropriately. Give it
a try a let me know if you are still having problems.

Daniel




"Daniel" wrote:

> 1- It will only get triggered after you set the focus onto another field.
>
> 2- Depending on how everything is setup you may need to use a function such
> as ...=clng(me.SubFormname.Form![Name of Second Field]) + clng(me.[Name of
> First Field]) to ensure that they are processed numerically. For more info
> check 'Type Conversion Functions' in the help menu.
>
> Daniel
>
>
>
>
>
>
> "bill" wrote:
>
> > well i tried that code but unfortunatly i didnt watch any action.
> > then i tried of me.[Name of First Field] =me.SubFormname.Form![Name of
> > Second Field] +me.[Name of First Field]
> > but still nothing.
> >
> > if u think something else Daniel pls let me know.
> > Thanks
> > "Daniel" wrote:
> >
> > > try using the afterupdate event of the first field and add the following code
> > >
> > > me.[Name of First Field] =me.[Name of Second Field] +me.[Name of First Field]
> > >
> > > Daniel
> > >
> > >
> > >
> > > "bill" wrote:
> > >
> > > > hi
> > > > there is a number(data type) field and another number field in a subform.
> > > > all i want is every time i type a number into the second field (the subform
> > > > field ), the first field to get updated , its current value plus that
> > > > number.is that possible?
> > > >

 
Reply With Quote
 
=?Utf-8?B?YmlsbA==?=
Guest
Posts: n/a
 
      11th Dec 2006
hmm yes u have right its working fine...i forgot to tell you the most
important, the second textbox its a "function calculated" box calculating the
dateDif.
Do i have to store that value back to the table first and then write the
code u gave me?


"Daniel" wrote:

> Bill,
>
> I made a small mockup to test. the form has 2 text boxes (txtValue1 &
> txtValue2). Also, I ensured that both text boxes where set as 'General
> Number' format mode in the properties. Then I coded the following
>
> Private Sub txtValue1_AfterUpdate()
> Me.txtValue1 = Me.txtValue1 + Me.txtValue2
> End Sub
>
> and it works fine. Whenever I make a change in value an move my mouse to
> the second text box the first one's value is adjusted appropriately. Give it
> a try a let me know if you are still having problems.
>
> Daniel
>
>
>
>
> "Daniel" wrote:
>
> > 1- It will only get triggered after you set the focus onto another field.
> >
> > 2- Depending on how everything is setup you may need to use a function such
> > as ...=clng(me.SubFormname.Form![Name of Second Field]) + clng(me.[Name of
> > First Field]) to ensure that they are processed numerically. For more info
> > check 'Type Conversion Functions' in the help menu.
> >
> > Daniel
> >
> >
> >
> >
> >
> >
> > "bill" wrote:
> >
> > > well i tried that code but unfortunatly i didnt watch any action.
> > > then i tried of me.[Name of First Field] =me.SubFormname.Form![Name of
> > > Second Field] +me.[Name of First Field]
> > > but still nothing.
> > >
> > > if u think something else Daniel pls let me know.
> > > Thanks
> > > "Daniel" wrote:
> > >
> > > > try using the afterupdate event of the first field and add the following code
> > > >
> > > > me.[Name of First Field] =me.[Name of Second Field] +me.[Name of First Field]
> > > >
> > > > Daniel
> > > >
> > > >
> > > >
> > > > "bill" wrote:
> > > >
> > > > > hi
> > > > > there is a number(data type) field and another number field in a subform.
> > > > > all i want is every time i type a number into the second field (the subform
> > > > > field ), the first field to get updated , its current value plus that
> > > > > number.is that possible?
> > > > >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
current week, current month, current year joemeshuggah Microsoft Excel Programming 1 14th Oct 2008 06:44 PM
OperationContext.Current or HttpContext.Current in MembershipProvider within WCF Service = null? dgilbert@cragmonttech.com Microsoft C# .NET 4 18th May 2007 05:24 PM
Calculating current investment value, current mortgage balance Scott Meyers Microsoft Excel Worksheet Functions 1 10th Jul 2004 08:13 PM
changing current directory to that of the current open file unnameable Microsoft Excel Programming 2 19th May 2004 11:14 AM
How to change the current thread current culture at run time. Manu Microsoft ASP .NET 1 20th Jul 2003 04:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:51 AM.