Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Join Date
    Feb 2009
    Posts
    19

    Unanswered: turning simbols to meaningful data.

    Halo there, need some pro to help me to work this puzzle that buzzing on my head.

    If i have a set of data :

    791011-12-5739 (actual data input : 791011125739)
    or
    610130-12-5664 (actual data input : 610130125664)

    ---------------------------
    So, how can i make this data : 791011 ----> 11/10/1979
    610130-----> 30/01/1961

    5739 -----> Male (referring to last digit '1,3,5,7,9')
    5664 -----> Female (referring to last digit '0, 2, 4,6,8)

    --------with automation filling data.
    Target 1.

    Input data : 791011125739

    ---auto generate
    Date of birth : 11/10/1979
    Gender/ Sex : Male


    Target 2

    Input data : 610130125664

    ---auto generate
    Date of birth : 30/01/1961
    Gender / Sex : Female


    ....Pro, help me with this auto generate puzzle. TQ

  2. #2
    Join Date
    Jun 2007
    Location
    Maitland NSW,Australia
    Posts
    388
    Example 791011125739
    Use the MID function to format 791011 into a date.

    Then use the RIGHT function to determine the last digit. Use the CASE statement to determine the GENDER/SEX based on the value from the RIGHT function.

    Is your example a numeric value or text? How would the year 2003 be displayed 031011125739 or 31011125739? Also, at what point in your data does the year change from 1900 to 2000 format?

  3. #3
    Join Date
    Feb 2009
    Posts
    19

    Re

    setting data ---> numeric.
    i assume that if i input 001107 ----> output : 07/11/2000
    (This b'cos i am handling patient database in a realtime (present))

    could u plz teach me VBA so i can get the result?? Specific...

    TQ. Pro

  4. #4
    Join Date
    Feb 2009
    Posts
    19

    re

    Correction ----> Setting data input : text

  5. #5
    Join Date
    Jun 2007
    Location
    Maitland NSW,Australia
    Posts
    388
    Ok, so the data is a text file. Now the first two digits represent the year if the digits are before 10 then one the user can assume that the year range is 1910 to 1999. Before 10 then the date range is 2000 to 2009. How would you code a person who is 100 years and older i.e. born before 1910?

    Using your example actual data input : 791011125739 is this entered on a form and where do you want the Date of Birth and Gender/Sex displayed or stored?

  6. #6
    Join Date
    Feb 2009
    Posts
    19

    re

    Assume that i've a set set of table.

    The contains:
    1. Id_Patient ( example : 791011125479) (input)
    2. DOB (date of birth : 11/10/1979 <--- generate from vba code)
    3. Gender ( 'male' <----generate from vba code)

    -----data input should be done on form (user interface)
    -----data stored on table.

    Chart Flow:

    Input data (Id_Patient)-----auto generate---------->DOB & Gender
    Last edited by nabalu; 04-07-09 at 00:04.

  7. #7
    Join Date
    Feb 2009
    Posts
    19

    re

    The aged who =/> 100 years, is entered by difference way. Using another method,; but for now, pro, can we focus on this??? TQ

  8. #8
    Join Date
    Jun 2007
    Location
    Maitland NSW,Australia
    Posts
    388
    Here is a sample database

    Enter the patient ID on the form, then the DOB and Gender will be generated after the Patient ID is entered.

    This assumes that the coding for the date of birth is correct e.g. 791231 and not 791232 etc.
    Attached Files Attached Files

  9. #9
    Join Date
    Feb 2009
    Posts
    19
    TQ Pro,.. it was great that u've done it. Great to know u.

    Thx to u.
    Last edited by nabalu; 04-07-09 at 00:53.

  10. #10
    Join Date
    Feb 2009
    Posts
    19

    handling error

    assume, i entered a wrong input (791032),.. error handler do this.
    ---> 1. error msg appear && database not update.
    ---> 2. error msg appear 'asking for the right data?'

    Q. How to accomplish this?
    Last edited by nabalu; 04-07-09 at 02:56.

  11. #11
    Join Date
    Jun 2007
    Location
    Maitland NSW,Australia
    Posts
    388
    It is possible to validate the date part of the input. But first I would change the form layout and use an unbound form as you can have better control over the input etc.

  12. #12
    Join Date
    Feb 2009
    Posts
    19

    re

    Pro, sorry for asking ur help too much, but, i am lack of knowledge with vba; but i understand what it does. i love vb, cos' i've done great things with ms access. All hard coded on my current project taken from various site, but, still, i can't write the code my self.

  13. #13
    Join Date
    Jun 2007
    Location
    Maitland NSW,Australia
    Posts
    388
    You can not ask too many questions, this is the way that you learn.

    Do you still want validation for your data input as per your previous post? If so I will post an updated version over the next few days, when time permits.

  14. #14
    Join Date
    Feb 2009
    Posts
    19
    TQ. Yes, pro, i would like to.

  15. #15
    Join Date
    Feb 2009
    Posts
    19

    little more vba code help.

    Halo pro.
    This is an add on with the current ID_Patient code.

    Let me begin with :

    Patient ID = 891009125859

    'I would like to extract only the last 4 digit = 5859
    'then reformat it (txtReformat_1) to be = 9585
    With this data, 5859 ; i need to rereformat it to another single data (display only),

    Case 1 = 891009125859 (from ID_Patient)
    'extract last 4 digits to txtReformat_1 (display only)
    Case 2 = 5859 (txtReformat_1)
    'reformat data case 2
    Case 3 = 9585
    'extract data into 3 seperate data to txtModified
    txtModified_1 = 5
    txtModified_2 = 8
    txtModified_3 = 59
    'Read from right to left.

    tq pro... really need your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •