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. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
Parameter for Button
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" wrote: 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! |
#12
|
|||
|
|||
Parameter for Button
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" wrote: 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 | |
|
|