Performing math in VB from an Access Form

  • Thread starter Thread starter Isis
  • Start date Start date
I

Isis

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
 
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))
 
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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Enter Parameter Value in Access Form 0
Outlook Creating an Outlook form 2
I will never get this program!!!! 4
how can I perform a math funcion in word 6
Access MS Access VB 0
DLookup or similar function 3
Access math 1
Math 1

Back
Top