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 » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Parameter for Button



 
 
Thread Tools Display Modes
  #1  
Old May 7th, 2007, 02:01 PM posted to microsoft.public.access.reports
Amour
external usenet poster
 
Posts: 115
Default Parameter for Button

Hi I am new to Access/VBA. Anyway this is the problem I am having:

I want to click on a button (within a form). Be prompted for a percent of
milage. Example: 0.485 or 0.455, then click ok and it change the caption
(display) on the command button to that value. Take that same value and
multiple it by the miles.

Please help and thank you!
  #2  
Old May 7th, 2007, 06:30 PM posted to microsoft.public.access.reports
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Parameter for Button

Do not use a label (caption) but change the appearance of a textbox. Create
an event so that on update is sets value of your mileage times percent.
--
KARL DEWEY
Build a little - Test a little


"Amour" wrote:

Hi I am new to Access/VBA. Anyway this is the problem I am having:

I want to click on a button (within a form). Be prompted for a percent of
milage. Example: 0.485 or 0.455, then click ok and it change the caption
(display) on the command button to that value. Take that same value and
multiple it by the miles.

Please help and thank you!

  #3  
Old May 7th, 2007, 07:02 PM posted to microsoft.public.access.reports
Amour
external usenet poster
 
Posts: 115
Default Parameter for Button

Thank you for your help. I don't understand what you mean.

Basically I want to change what they see in the text box (or command button)
to what the user typed in. Could you show me an example of an event that
will change on the form? by the user....

Thank You for any help....

"KARL DEWEY" wrote:

Do not use a label (caption) but change the appearance of a textbox. Create
an event so that on update is sets value of your mileage times percent.
--
KARL DEWEY
Build a little - Test a little


"Amour" wrote:

Hi I am new to Access/VBA. Anyway this is the problem I am having:

I want to click on a button (within a form). Be prompted for a percent of
milage. Example: 0.485 or 0.455, then click ok and it change the caption
(display) on the command button to that value. Take that same value and
multiple it by the miles.

Please help and thank you!

  #4  
Old May 7th, 2007, 07:20 PM posted to microsoft.public.access.reports
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Parameter for Button

Take that same value and multiple it by the miles.
Where are you going to put the value of this calculation?

--
KARL DEWEY
Build a little - Test a little


"Amour" wrote:

Thank you for your help. I don't understand what you mean.

Basically I want to change what they see in the text box (or command button)
to what the user typed in. Could you show me an example of an event that
will change on the form? by the user....

Thank You for any help....

"KARL DEWEY" wrote:

Do not use a label (caption) but change the appearance of a textbox. Create
an event so that on update is sets value of your mileage times percent.
--
KARL DEWEY
Build a little - Test a little


"Amour" wrote:

Hi I am new to Access/VBA. Anyway this is the problem I am having:

I want to click on a button (within a form). Be prompted for a percent of
milage. Example: 0.485 or 0.455, then click ok and it change the caption
(display) on the command button to that value. Take that same value and
multiple it by the miles.

Please help and thank you!

  #5  
Old May 7th, 2007, 07:44 PM posted to microsoft.public.access.reports
Amour
external usenet poster
 
Posts: 115
Default Parameter for Button

I have to display the value on the form that was typed in and also I have to
take that value and multiple it by miles, given an amount. Also I don't want
to write to the table (this is just for displaying and mult)...

Example:

Private Sub MilAmt_BeforeUpdate(Cancel As Integer)
Me.Mileage = Me.MilAmt * 0.485
End Sub

But you see I don't want the program to have a fixed value of: 0.458 I want
that value to be changed by the user say something like:

Private Sub MilAmt_BeforeUpdate(Cancel As Integer)
Me.Mileage = Me.MilAmt * [value changed by user]
End Sub

I also want that value to be display on the form....

I guess it would be something that you click on and that gives you a prompt
to enter in a percentage.

please help and thank you!
"KARL DEWEY" wrote:

Take that same value and multiple it by the miles.

Where are you going to put the value of this calculation?

--
KARL DEWEY
Build a little - Test a little


"Amour" wrote:

Thank you for your help. I don't understand what you mean.

Basically I want to change what they see in the text box (or command button)
to what the user typed in. Could you show me an example of an event that
will change on the form? by the user....

Thank You for any help....

"KARL DEWEY" wrote:

Do not use a label (caption) but change the appearance of a textbox. Create
an event so that on update is sets value of your mileage times percent.
--
KARL DEWEY
Build a little - Test a little


"Amour" wrote:

Hi I am new to Access/VBA. Anyway this is the problem I am having:

I want to click on a button (within a form). Be prompted for a percent of
milage. Example: 0.485 or 0.455, then click ok and it change the caption
(display) on the command button to that value. Take that same value and
multiple it by the miles.

Please help and thank you!

  #6  
Old May 7th, 2007, 09:09 PM posted to microsoft.public.access.reports
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Parameter for Button

I use macros instead of code.
Create an unbound textbox and enter default as "Enter % as a decimal",
set the Back Color 12632256, and Special Effect Raised.
For the After Update enter Macro11.MileageUpdate and then in the macro
select action of SetValue. In Item put
[Forms]![YourFormName]![YourMultipliedTextBox]. In Expression put
[Forms]![YourFormName]![YourMultiplierTextBox] *
[Forms]![YourFormName]![YourMileageTextBox].

[Forms]![YourFormName]![YourMultipliedTextBox] -- Where the results will
be displayed
[Forms]![YourFormName]![YourMultiplierTextBox] -- Where you enter the
percentage.
[Forms]![YourFormName]![YourMileageTextBox] -- Where the mileage is from.

Substitue you form object names for those I used.

--
KARL DEWEY
Build a little - Test a little


"Amour" wrote:

I have to display the value on the form that was typed in and also I have to
take that value and multiple it by miles, given an amount. Also I don't want
to write to the table (this is just for displaying and mult)...

Example:

Private Sub MilAmt_BeforeUpdate(Cancel As Integer)
Me.Mileage = Me.MilAmt * 0.485
End Sub

But you see I don't want the program to have a fixed value of: 0.458 I want
that value to be changed by the user say something like:

Private Sub MilAmt_BeforeUpdate(Cancel As Integer)
Me.Mileage = Me.MilAmt * [value changed by user]
End Sub

I also want that value to be display on the form....

I guess it would be something that you click on and that gives you a prompt
to enter in a percentage.

please help and thank you!
"KARL DEWEY" wrote:

Take that same value and multiple it by the miles.

Where are you going to put the value of this calculation?

--
KARL DEWEY
Build a little - Test a little


"Amour" wrote:

Thank you for your help. I don't understand what you mean.

Basically I want to change what they see in the text box (or command button)
to what the user typed in. Could you show me an example of an event that
will change on the form? by the user....

Thank You for any help....

"KARL DEWEY" wrote:

Do not use a label (caption) but change the appearance of a textbox. Create
an event so that on update is sets value of your mileage times percent.
--
KARL DEWEY
Build a little - Test a little


"Amour" wrote:

Hi I am new to Access/VBA. Anyway this is the problem I am having:

I want to click on a button (within a form). Be prompted for a percent of
milage. Example: 0.485 or 0.455, then click ok and it change the caption
(display) on the command button to that value. Take that same value and
multiple it by the miles.

Please help and thank you!

  #7  
Old May 8th, 2007, 02:20 PM posted to microsoft.public.access.reports
Amour
external usenet poster
 
Posts: 115
Default Parameter for Button

Thank You again for your help. I don't understand where to put the rest of:

[Forms]![YourFormName]![YourMultipliedTextBox] -- Where the results will
be displayed
[Forms]![YourFormName]![YourMultiplierTextBox] -- Where you enter the
percentage.
[Forms]![YourFormName]![YourMileageTextBox] -- Where the mileage is from.

I currently have a bound textbox that stores that amount: mileage(Text name:
Txtmileage) = TxtmilAmt * Macro11.

Also I have another Textbox TxtMilAmt that stores the amount of miles.

Please help and thank you!


"KARL DEWEY" wrote:

I use macros instead of code.
Create an unbound textbox and enter default as "Enter % as a decimal",
set the Back Color 12632256, and Special Effect Raised.
For the After Update enter Macro11.MileageUpdate and then in the macro
select action of SetValue. In Item put
[Forms]![YourFormName]![YourMultipliedTextBox]. In Expression put
[Forms]![YourFormName]![YourMultiplierTextBox] *
[Forms]![YourFormName]![YourMileageTextBox].

[Forms]![YourFormName]![YourMultipliedTextBox] -- Where the results will
be displayed
[Forms]![YourFormName]![YourMultiplierTextBox] -- Where you enter the
percentage.
[Forms]![YourFormName]![YourMileageTextBox] -- Where the mileage is from.

Substitue you form object names for those I used.

--
KARL DEWEY
Build a little - Test a little


"Amour" wrote:

I have to display the value on the form that was typed in and also I have to
take that value and multiple it by miles, given an amount. Also I don't want
to write to the table (this is just for displaying and mult)...

Example:

Private Sub MilAmt_BeforeUpdate(Cancel As Integer)
Me.Mileage = Me.MilAmt * 0.485
End Sub

But you see I don't want the program to have a fixed value of: 0.458 I want
that value to be changed by the user say something like:

Private Sub MilAmt_BeforeUpdate(Cancel As Integer)
Me.Mileage = Me.MilAmt * [value changed by user]
End Sub

I also want that value to be display on the form....

I guess it would be something that you click on and that gives you a prompt
to enter in a percentage.

please help and thank you!
"KARL DEWEY" wrote:

Take that same value and multiple it by the miles.
Where are you going to put the value of this calculation?

--
KARL DEWEY
Build a little - Test a little


"Amour" wrote:

Thank you for your help. I don't understand what you mean.

Basically I want to change what they see in the text box (or command button)
to what the user typed in. Could you show me an example of an event that
will change on the form? by the user....

Thank You for any help....

"KARL DEWEY" wrote:

Do not use a label (caption) but change the appearance of a textbox. Create
an event so that on update is sets value of your mileage times percent.
--
KARL DEWEY
Build a little - Test a little


"Amour" wrote:

Hi I am new to Access/VBA. Anyway this is the problem I am having:

I want to click on a button (within a form). Be prompted for a percent of
milage. Example: 0.485 or 0.455, then click ok and it change the caption
(display) on the command button to that value. Take that same value and
multiple it by the miles.

Please help and thank you!

  #8  
Old May 8th, 2007, 03:00 PM posted to microsoft.public.access.reports
Amour
external usenet poster
 
Posts: 115
Default Parameter for Button

Again Thank you for any help. Also I don't understand about:

Macro11.MileageUpdate

I put this statement in the After Update on the Text field. Is this the
whole name of the Macro (I know nothing about macro's). Right now I created
a macro named: MacTrv and put what you said in the Item and Expression.

Please help and thank you!


"KARL DEWEY" wrote:

I use macros instead of code.
Create an unbound textbox and enter default as "Enter % as a decimal",
set the Back Color 12632256, and Special Effect Raised.
For the After Update enter Macro11.MileageUpdate and then in the macro
select action of SetValue. In Item put
[Forms]![YourFormName]![YourMultipliedTextBox]. In Expression put
[Forms]![YourFormName]![YourMultiplierTextBox] *
[Forms]![YourFormName]![YourMileageTextBox].

[Forms]![YourFormName]![YourMultipliedTextBox] -- Where the results will
be displayed
[Forms]![YourFormName]![YourMultiplierTextBox] -- Where you enter the
percentage.
[Forms]![YourFormName]![YourMileageTextBox] -- Where the mileage is from.

Substitue you form object names for those I used.

--
KARL DEWEY
Build a little - Test a little


"Amour" wrote:

I have to display the value on the form that was typed in and also I have to
take that value and multiple it by miles, given an amount. Also I don't want
to write to the table (this is just for displaying and mult)...

Example:

Private Sub MilAmt_BeforeUpdate(Cancel As Integer)
Me.Mileage = Me.MilAmt * 0.485
End Sub

But you see I don't want the program to have a fixed value of: 0.458 I want
that value to be changed by the user say something like:

Private Sub MilAmt_BeforeUpdate(Cancel As Integer)
Me.Mileage = Me.MilAmt * [value changed by user]
End Sub

I also want that value to be display on the form....

I guess it would be something that you click on and that gives you a prompt
to enter in a percentage.

please help and thank you!
"KARL DEWEY" wrote:

Take that same value and multiple it by the miles.
Where are you going to put the value of this calculation?

--
KARL DEWEY
Build a little - Test a little


"Amour" wrote:

Thank you for your help. I don't understand what you mean.

Basically I want to change what they see in the text box (or command button)
to what the user typed in. Could you show me an example of an event that
will change on the form? by the user....

Thank You for any help....

"KARL DEWEY" wrote:

Do not use a label (caption) but change the appearance of a textbox. Create
an event so that on update is sets value of your mileage times percent.
--
KARL DEWEY
Build a little - Test a little


"Amour" wrote:

Hi I am new to Access/VBA. Anyway this is the problem I am having:

I want to click on a button (within a form). Be prompted for a percent of
milage. Example: 0.485 or 0.455, then click ok and it change the caption
(display) on the command button to that value. Take that same value and
multiple it by the miles.

Please help and thank you!

  #9  
Old May 8th, 2007, 03:08 PM posted to microsoft.public.access.reports
Amour
external usenet poster
 
Posts: 115
Default Parameter for Button

Hi again do you mean to put this:

[Forms]![YourFormName]![YourMultipliedTextBox] -- Where the results will
be displayed
[Forms]![YourFormName]![YourMultiplierTextBox] -- Where you enter the
percentage.
[Forms]![YourFormName]![YourMileageTextBox] -- Where the mileage is from.

Into the Control source in each one of the Textbox fields? right now I have
a bound field = MilAmt (this is the number of miles) and another bound field
= Mileage (this is the MilAmt * macTrv).

Please help and Thank you!

"KARL DEWEY" wrote:

I use macros instead of code.
Create an unbound textbox and enter default as "Enter % as a decimal",
set the Back Color 12632256, and Special Effect Raised.
For the After Update enter Macro11.MileageUpdate and then in the macro
select action of SetValue. In Item put
[Forms]![YourFormName]![YourMultipliedTextBox]. In Expression put
[Forms]![YourFormName]![YourMultiplierTextBox] *
[Forms]![YourFormName]![YourMileageTextBox].

[Forms]![YourFormName]![YourMultipliedTextBox] -- Where the results will
be displayed
[Forms]![YourFormName]![YourMultiplierTextBox] -- Where you enter the
percentage.
[Forms]![YourFormName]![YourMileageTextBox] -- Where the mileage is from.

Substitue you form object names for those I used.

--
KARL DEWEY
Build a little - Test a little


"Amour" wrote:

I have to display the value on the form that was typed in and also I have to
take that value and multiple it by miles, given an amount. Also I don't want
to write to the table (this is just for displaying and mult)...

Example:

Private Sub MilAmt_BeforeUpdate(Cancel As Integer)
Me.Mileage = Me.MilAmt * 0.485
End Sub

But you see I don't want the program to have a fixed value of: 0.458 I want
that value to be changed by the user say something like:

Private Sub MilAmt_BeforeUpdate(Cancel As Integer)
Me.Mileage = Me.MilAmt * [value changed by user]
End Sub

I also want that value to be display on the form....

I guess it would be something that you click on and that gives you a prompt
to enter in a percentage.

please help and thank you!
"KARL DEWEY" wrote:

Take that same value and multiple it by the miles.
Where are you going to put the value of this calculation?

--
KARL DEWEY
Build a little - Test a little


"Amour" wrote:

Thank you for your help. I don't understand what you mean.

Basically I want to change what they see in the text box (or command button)
to what the user typed in. Could you show me an example of an event that
will change on the form? by the user....

Thank You for any help....

"KARL DEWEY" wrote:

Do not use a label (caption) but change the appearance of a textbox. Create
an event so that on update is sets value of your mileage times percent.
--
KARL DEWEY
Build a little - Test a little


"Amour" wrote:

Hi I am new to Access/VBA. Anyway this is the problem I am having:

I want to click on a button (within a form). Be prompted for a percent of
milage. Example: 0.485 or 0.455, then click ok and it change the caption
(display) on the command button to that value. Take that same value and
multiple it by the miles.

Please help and thank you!

  #10  
Old May 8th, 2007, 10:49 PM posted to microsoft.public.access.reports
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Parameter for Button

That is just an explaination of the information.

--
KARL DEWEY
Build a little - Test a little


"Amour" wrote:

Hi again do you mean to put this:

[Forms]![YourFormName]![YourMultipliedTextBox] -- Where the results will
be displayed
[Forms]![YourFormName]![YourMultiplierTextBox] -- Where you enter the
percentage.
[Forms]![YourFormName]![YourMileageTextBox] -- Where the mileage is from.

Into the Control source in each one of the Textbox fields? right now I have
a bound field = MilAmt (this is the number of miles) and another bound field
= Mileage (this is the MilAmt * macTrv).

Please help and Thank you!

"KARL DEWEY" wrote:

I use macros instead of code.
Create an unbound textbox and enter default as "Enter % as a decimal",
set the Back Color 12632256, and Special Effect Raised.
For the After Update enter Macro11.MileageUpdate and then in the macro
select action of SetValue. In Item put
[Forms]![YourFormName]![YourMultipliedTextBox]. In Expression put
[Forms]![YourFormName]![YourMultiplierTextBox] *
[Forms]![YourFormName]![YourMileageTextBox].

[Forms]![YourFormName]![YourMultipliedTextBox] -- Where the results will
be displayed
[Forms]![YourFormName]![YourMultiplierTextBox] -- Where you enter the
percentage.
[Forms]![YourFormName]![YourMileageTextBox] -- Where the mileage is from.

Substitue you form object names for those I used.

--
KARL DEWEY
Build a little - Test a little


"Amour" wrote:

I have to display the value on the form that was typed in and also I have to
take that value and multiple it by miles, given an amount. Also I don't want
to write to the table (this is just for displaying and mult)...

Example:

Private Sub MilAmt_BeforeUpdate(Cancel As Integer)
Me.Mileage = Me.MilAmt * 0.485
End Sub

But you see I don't want the program to have a fixed value of: 0.458 I want
that value to be changed by the user say something like:

Private Sub MilAmt_BeforeUpdate(Cancel As Integer)
Me.Mileage = Me.MilAmt * [value changed by user]
End Sub

I also want that value to be display on the form....

I guess it would be something that you click on and that gives you a prompt
to enter in a percentage.

please help and thank you!
"KARL DEWEY" wrote:

Take that same value and multiple it by the miles.
Where are you going to put the value of this calculation?

--
KARL DEWEY
Build a little - Test a little


"Amour" wrote:

Thank you for your help. I don't understand what you mean.

Basically I want to change what they see in the text box (or command button)
to what the user typed in. Could you show me an example of an event that
will change on the form? by the user....

Thank You for any help....

"KARL DEWEY" wrote:

Do not use a label (caption) but change the appearance of a textbox. Create
an event so that on update is sets value of your mileage times percent.
--
KARL DEWEY
Build a little - Test a little


"Amour" wrote:

Hi I am new to Access/VBA. Anyway this is the problem I am having:

I want to click on a button (within a form). Be prompted for a percent of
milage. Example: 0.485 or 0.455, then click ok and it change the caption
(display) on the command button to that value. Take that same value and
multiple it by the miles.

Please help and thank you!

 




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


All times are GMT +1. The time now is 12:58 PM.


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