Results 1 to 4 of 4
  1. #1
    Join Date
    May 2004
    Location
    South Australia
    Posts
    39

    Unanswered: Input Mask for Names, A Counter, and Duplication Testing

    Hi

    Ok,
    The content of my previous thread just up and walked away (dissapeared), so I'll start from the beginning.

    I've got three little (I hope ) problems that I'm struggling with, and would appreciate advice on. They are as follows:

    1)
    I'd like to use an input mask that will basically capialise the first letter (and possibly the first letter after a space), but will allow me to enter the rest of the text in any way I like - whether it be spaces, lowercase, uppercase, hyphens, etc.

    2)
    I'd like to put sequential numbers down the side of a report. ie. row 1, row 2, row 3, etc.

    In the previous thread, Bud suggested that I use a TextBox with a -1, and set the Running Sum to OverAll. For some reason this results in the first record being left blank and the rest as 0's. Can anyone suggest what I've done wrong?

    3)
    Finally, I have a situation where the user needs to enter the names of a group of students at once. Most of these students will be new and not pose a problem, however some will be past students returning for another course.
    Is there any way to set a rule/whatever that will check to see if the new student's name matches a past student, and if so to display the matching student's details and prompt the user for an action? (either continue entering student's details or skip to entering next student.

    Thanks for your suggestion regarding this Bud (to set Yes/NoDuplicates in the indexed line of the table properties), however I believe that this would not work in this situation, as some students may be different people but have the same name. The user needs to be able to enter duplicate names, I would just like the database to warn them first.

    Thanks for any and all help,

    frekster

  2. #2
    Join Date
    Jun 2004
    Posts
    96
    1: If I'm not wrong, upper/lower case mask apply to the rest of the string, sorry.. I can't help on this.

    2: try "=1" instead and running sum

    3: if you have forms for data entry, you can use DLookUp to look for names in the tables (when the name textbox loses focus), and if it's found (returns non null), display the warning message.

    Cyherus

  3. #3
    Join Date
    May 2004
    Location
    South Australia
    Posts
    39
    Thanks for the reply Cyherus.

    It doesn't matter about the input masks now - I've decided it's just not worth it.
    I messed around with similar ideas instead of the -1 and got lucky with 0+1 and no running sum. Seems to act like an x+1. I'll give =1 a try though, and see what happens.

    With the DLookUp, if you have the time, would you be able to give me a basic structure of code to use (or anyone else for that matter)? I've never used it before, and the help on Access 2002 seems pretty scarce on details. It sounds like it's exactly what I need.

    Thanks for your time

    frekster

  4. #4
    Join Date
    Jun 2004
    Posts
    96
    DLookup("field", "table", "criteria")
    this returns a variant and if returned value = null.. then this record does not exist in the database/tables.

    example:
    dim VarX as Variant
    dim StrCriteria as String

    StrCriteria = "[Name] = '" & Me.txtName & "'"
    varX = DLookup("[Name]", "Employees", StrCriteria)
    if not isNull(varX) then
    prompts this name already exist..
    end if

    Cyherus

Posting Permissions

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