Normal Topic Help with Code (Read 747 times)
proudpoppy
Full Member
Members
***
Offline


Do What ??

Posts: 420
Location: South Carolina
Joined: Apr 7th, 2004
Help with Code
Feb 6th, 2009 at 3:11pm
Print Post Print Post  
I have added a checkbox to my subform “employeedata” and if checked I would like the total time to be 1-1/2  instead of normal can you help me with the code?




var vtime as int=1
var vmaxtime as int = @formresultsettotal("employeedata")
Var vgrandtime as double = 0

while vtime <= vmaxtime


//Need to add code that if overtime box is checked then time on job will be equal to 1-1/2 time.


{
vgrandtime = vgrandtime + @Tonumber(@formfieldvalue("employeedata","Time on job",vtime))
vtime = vtime + 1
}
Total time on job = vgrandtime

Days to Complete = wo_Date_Completed - wo_Date_started
Days Backlogged = wo_Date_Started  - Date_Received
MateriaLCharge = Grand total0


TotalCharge = Materialcharge + Labor charge

xpost(@Fn,LE35,"Wk_Req_Form!Request_Number",WO_Number,"Work_Order_Number","")
xpost(@Fn,LE35,"Wk_Req_Form!Request_Number",Statis,"LE8","")
xpost(@Fn,LE35,"Wk_Req_Form!Request_Number",Statis,"WO_Statis","")
xpost(@Fn,WO_Number,"Schedule!Wonumber",Statis,"Statis","")

  
Back to top
 
IP Logged
 
Ben
Lantica Support
*****
Offline



Posts: 218
Joined: Apr 7th, 2005
Re: Help with Code
Reply #1 - Feb 6th, 2009 at 4:30pm
Print Post Print Post  
You would want something like:

If employeedata = 1 Then
{
   Total Time On Job= vGrandTime * 1.5
}
Else
{
   Total Time On Job = vGrandTime * 1
}
  
Back to top
IP Logged
 
proudpoppy
Full Member
Members
***
Offline


Do What ??

Posts: 420
Location: South Carolina
Joined: Apr 7th, 2004
Re: Help with Code
Reply #2 - Feb 6th, 2009 at 5:22pm
Print Post Print Post  
O.k. got it, follow up question, In a checkbox on a subform, why want it let you put a check in it?
  
Back to top
 
IP Logged
 
Ben
Lantica Support
*****
Offline



Posts: 218
Joined: Apr 7th, 2005
Re: Help with Code
Reply #3 - Feb 6th, 2009 at 6:57pm
Print Post Print Post  
If you are using a tableview subform, you will be limited to Yes/No, 1/0, True/False... etc.

If you are using a formview subform, check to make sure that you do not have any programming restricting you from changing that element. Also check to make sure that your element is not set to be read only.
  
Back to top
IP Logged
 
proudpoppy
Full Member
Members
***
Offline


Do What ??

Posts: 420
Location: South Carolina
Joined: Apr 7th, 2004
Re: Help with Code
Reply #4 - Feb 6th, 2009 at 8:17pm
Print Post Print Post  
Table View, but Y/N works.  Wink
  
Back to top
 
IP Logged