Parameter for Button

A

Amour

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!
 
K

KARL DEWEY

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

Amour

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

KARL DEWEY

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

Amour

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!
 
K

KARL DEWEY

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 said:
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 said:
Where are you going to put the value of this calculation?
 
A

Amour

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 said:
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 said:
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 said:
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


:

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

:

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


:

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!
 
A

Amour

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 said:
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 said:
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 said:
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


:

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

:

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


:

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!
 
A

Amour

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 said:
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 said:
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 said:
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


:

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

:

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


:

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!
 
K

KARL DEWEY

That is just an explaination of the information.

--
KARL DEWEY
Build a little - Test a little


Amour said:
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 said:
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 said:
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!
:

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


:

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

:

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


:

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!
 
K

KARL DEWEY

You will need to do some reading on macros.
A macro may do a single set of actions or by using an overall name then have
multiple sets of action under that name.
Macro11.MileageUpdate would be a macro Macro11 with another name inside of
MileageUpdate that specifies which set of actions are to be iniated.
--
KARL DEWEY
Build a little - Test a little


Amour said:
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 said:
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 said:
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!
:

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


:

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

:

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


:

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!
 
A

Amour

Thank you I did something different and that helped. You see I needed to
store this percentage (what if they wanted to update the record)...

KARL DEWEY said:
That is just an explaination of the information.

--
KARL DEWEY
Build a little - Test a little


Amour said:
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 said:
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


:

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!
:

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


:

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

:

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


:

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!
 

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

Top