|
-
Dec 27th, 2004, 06:18 AM
#1
Thread Starter
Hyperactive Member
Re: Idea is Needed To Calculate an Annual Leave
It means I have to calculate the fields not the Value which is in the text Box that displayed from the Field itself ??
Current Project: General Employees Database (Employees Information) & (Training Details).
-
Dec 27th, 2004, 01:27 PM
#2
Re: Idea is Needed To Calculate an Annual Leave
Could you explain more?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 28th, 2004, 02:55 AM
#3
Thread Starter
Hyperactive Member
Re: Idea is Needed To Calculate an Annual Leave
Yes, What I mean to say. Is it possible calculating only the Objects rather than the DB Fields. I;E, In the First tab I have listed the all information for the employee inculding the Joining Date. Now, while the Joining Date is already assigned to an Object in the Form, is it possible to Calculate the Experiance from that Joining Date ? Not the Rs.Field("JoiningDate")
Code:
D = DateDiff("YYYY", Now, Me.txtJoiningDate.text)
txtExperiance.Text = D
What I want to know is once I calculated this Value, is it Possible to assign the Caluclated Field to Field in the Table ??
Or I have only one chooise is only Calculate the Fields ?? To assign the Value in to them ?
Many Thanks in advance,
Habibalby
Current Project: General Employees Database (Employees Information) & (Training Details).
-
Dec 31st, 2004, 02:33 PM
#4
Re: Idea is Needed To Calculate an Annual Leave
Yes, you can calculate from the values in the textboxes instead of querying the db.
Use something like this format...
VB Code:
Forms![Form1]![txtLeave].Value
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 1st, 2005, 01:24 AM
#5
Thread Starter
Hyperactive Member
Re: Idea is Needed To Calculate an Annual Leave
 Originally Posted by RobDog888
Yes, you can calculate from the values in the textboxes instead of querying the db.
Use something like this format...
VB Code:
Forms![Form1]![txtLeave].Value
Yes, I understood that it can be. But the Main Question is will it be possible to enter a Calculated Field into a Database Field ??
Example:
Code:
Total = Val(Text1.Text) * Val(Text2.Text)
Text3.Text = Total
Now is it possible to enter the Total into a Database Field?
Thanks Mate and Happy New Year.
Habibalby
Current Project: General Employees Database (Employees Information) & (Training Details).
-
Jan 1st, 2005, 04:00 PM
#6
Re: Idea is Needed To Calculate an Annual Leave
Yes, but you can only go one way for a calculated value. If your calculating it
from your ex. then you would have a field in the table that would take the
Total value. If you are trying to take a calculated value and place it into two
fields then you cant unless you have a formula to reverse engineer the values.
HTH
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 2nd, 2005, 05:23 AM
#7
Thread Starter
Hyperactive Member
Re: Idea is Needed To Calculate an Annual Leave
 Originally Posted by RobDog888
Yes, but you can only go one way for a calculated value. If your calculating it
from your ex. then you would have a field in the table that would take the
Total value. If you are trying to take a calculated value and place it into two
fields then you cant unless you have a formula to reverse engineer the values.
HTH
From you experiance, what you choose if you were me. Calculating the field taken this method:
Code:
Rs.Open "Data",Conn, .............,..............., adCmdTable
'Check for records returned
If rs.bof = False and rs.eof = False Then
oD = DateDiff("YYYY", Now, Rs.Field("JoiningDate").Value)
If Rs.Field("Experiance).Value = 4 Then
rsleave.fields("LeaveEntitled").Value = 21
Else
rsleave.fields("LeaveEntitled").Value = 28
End If
rsleave.update
Else
msgbox "Error - no records returned!"
End If
If rs.state = adstateopen Then Rs.Close
If rsleave.state = adstateopen Then RsLeave.Close
Set rs = Nothing
Set rsleave = Nothing
or doring this example:
Code:
Total = Val(Text1.Text) * Val(Text2.Text)
Text3.Text = Total
Thanks for your gratest reply dude.
Habibalby
Current Project: General Employees Database (Employees Information) & (Training Details).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|