Calculation carried out on click

Chimp8471

Registered User.
Local time
Today, 12:39
Joined
Mar 18, 2003
Messages
353
I am trying to get my database to carryout a calculation on the click of a button,

My form is split into a main form and a subform, this works fine and does exactly what is should, however I now need to make an alteration to it.

How this usually works, the user selects (Picture, section 1) an:

event code
a duration

then clicks the add event button, the data is then transferred to the subform as shown in the (picture, section 2).

My problem is that I am now requested to do the following:

If an a specific event code is selected, for example, Code F21 and it has a duration of 20 minutes, instead of this being transferred as :

F21 – 20 minutes

I now need to divide the 20 minutes by 4 so in fact the actual data transferred would be:

F21 – 5 mins

I am thinking that this would be required to be done in code but any ideas please.

Cheers

Andy
 

Attachments

  • MainForm.jpg
    MainForm.jpg
    52 KB · Views: 172
First, my site firewall would strip your download if I tried to get it, so I'm talking generalities here.

Second, the general idea is to put code where you want it to run.

So if you want something to run when you click a particular button, put that code in VBA code behind that button's OnClick event.
 

Users who are viewing this thread

Back
Top Bottom