A Microsoft Office (Excel, Word) forum. OfficeFrustration

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   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Performing math in VB from an Access Form



 
 
Thread Tools Display Modes
  #1  
Old March 13th, 2006, 01:05 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Performing math in VB from an Access Form

I have an access Form open - I have a button on the form and in the Click
Event I want to perform some math using the values of fields showing in the
form - so for instance on of the fields is 'Price' one of the fields is
'Shipping' I want to add the amount in 'Price' to the amount in 'Shipping'
and place it in a String for use elsewhere.

Can this be done from a VB statement ?

Thanks for any help

  #2  
Old March 13th, 2006, 02:23 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Performing math in VB from an Access Form

On 13 Mar 2006 01:05:05 GMT, Isis wrote:

I have an access Form open - I have a button on the form and in the Click
Event I want to perform some math using the values of fields showing in the
form - so for instance on of the fields is 'Price' one of the fields is
'Shipping' I want to add the amount in 'Price' to the amount in 'Shipping'
and place it in a String for use elsewhere.

Can this be done from a VB statement ?

Thanks for any help


Place it in a string? Are you sure?
Dim strString as String
strString = CStr(Nz([Price],0) + Nz([Shipping],0))



--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #3  
Old March 13th, 2006, 12:45 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Performing math in VB from an Access Form

fredg wrote in
:

On 13 Mar 2006 01:05:05 GMT, Isis wrote:

I have an access Form open - I have a button on the form and in the
Click Event I want to perform some math using the values of fields
showing in the form - so for instance on of the fields is 'Price' one
of the fields is 'Shipping' I want to add the amount in 'Price' to
the amount in 'Shipping' and place it in a String for use elsewhere.

Can this be done from a VB statement ?

Thanks for any help


Place it in a string? Are you sure?
Dim strString as String
strString = CStr(Nz([Price],0) + Nz([Shipping],0))




Thanks for the answer Fred - I am using a string because it is going to
be pasted into an email eventually.

What does the 'Nz' bit mean and what is the placeholder '0' for ?

Thanks again
  #4  
Old March 13th, 2006, 05:18 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Performing math in VB from an Access Form

On 13 Mar 2006 12:45:11 GMT, Isis wrote:

fredg wrote in
:

On 13 Mar 2006 01:05:05 GMT, Isis wrote:

I have an access Form open - I have a button on the form and in the
Click Event I want to perform some math using the values of fields
showing in the form - so for instance on of the fields is 'Price' one
of the fields is 'Shipping' I want to add the amount in 'Price' to
the amount in 'Shipping' and place it in a String for use elsewhere.

Can this be done from a VB statement ?

Thanks for any help


Place it in a string? Are you sure?
Dim strString as String
strString = CStr(Nz([Price],0) + Nz([Shipping],0))


Thanks for the answer Fred - I am using a string because it is going to
be pasted into an email eventually.

What does the 'Nz' bit mean and what is the placeholder '0' for ?

Thanks again


Open any code window and click on Help.
Type NZ in the index window and read what VBA help has to say.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 




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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Controls disappear from Data Entry form Paul Ponzelli Using Forms 10 February 26th, 2006 05:51 AM
Ambiguous Name Error pm Using Forms 10 June 5th, 2005 09:19 PM
Access Mail Merge to Word.doc files ? RNUSZ@OKDPS Setting Up & Running Reports 1 May 18th, 2005 06:31 PM
auto entry into second table after update Tony New Users 13 July 9th, 2004 10:42 PM
Linking Excel data through Access to use a Form as an Interface Laura Links and Linking 0 March 23rd, 2004 03:59 PM


All times are GMT +1. The time now is 01:15 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.