for simplicity you could do a datediff and return the No of Months then
Age = int(noofmonths/12) which will return the integer part ie the age.
You dont really need a function for this code one line will do
TheAge = int(Datedif(mon th,EnterDate, Now) /12)
User Profile
Collapse
-
-
what version of VB (i can give you a code sample i have used)
either way; you will need to bring in the text file (line by line or the whole thing depending on its size) and do a search for the Character using instr, then use the mid function to find the char display above and below.
See my post on replacement chars to see how you can search and manipulate strings (vb 6 example)Leave a comment:
-
i have modified my original code to handle replacement, rather than remove
it will need to be tested
It will be called as
Dim StringIwanttodi splay as string
Stringiwanttodi splay = ChangeChar(Stri ngiwanttodispla y,1,2)
The will replace all 1s with 2s in your string
Function ChangeChar(Name As String, Char_to_Change As String, Char_to_Change_ to as String...Leave a comment:
-
You should use functions for repeatable code as much as possible. The function i have given you allows you to pass in whatever character replacement that you want.
This reduces the amount of code that you need to write hence reducing the size of your app (performance)Leave a comment:
-
when i run the app even when i click on the form it goes to not responding. Can somebody please help with this or i will have to revert to vb 6 to write this
Thanks in advanceLeave a comment:
-
The whole form/app is not responding. it is not a problem with an individual control.Leave a comment:
-
use the instr function to determine the postion of the string
eg retvalue = instr(string to search, "what to search for")
This will tell you where the string is char you want to remove is
see example below i have used before in vb6 (may need a tweek in dot net)
*************Co de goes here*********** *************** ************
Function RemoveChar(Name As String,...Leave a comment:
-
vb.net form not responding
i am writing a data extract program that displays a progress bar and the current record on the screen. It all works fine except when i click on the form or on another application then it goes to 'not responding'.
The app eventually returns performing all its functions corrrectly but i need it to refresh the screen.
i have written similar programs in vb6 and i can click away from the program and then back and i the screen...
No activity results to display
Show More
Leave a comment: