Results 1 to 7 of 7

Thread: How 2 disable Auto calculation In VB?

  1. #1

    Thread Starter
    Lively Member bmh's Avatar
    Join Date
    Aug 2001
    Location
    Australia (Melbourne)
    Posts
    67

    How 2 disable Auto calculation In VB?

    I got problem with VB .... which making auto space for calculating the number's and the symbols .... Like " + = / - "

    and my problem is i want to make an if statment for recordset like and one of the fields have "-" between the words .... and i got problem with VB that saparate the words like substract them ...

    this is an example what I am facing :


    IF rstStudent!student - id = txtLoginID.text Then

    Do this Function ....

    Else

    Do this Function ....

    End IF


    Note : You can see how VB Making Space between Student and "-" and id ??? and it should be like this :

    IF rstStudent!student-id = txtLoginID.text Then



    How to avoid this in VB ??


    Thanks
    BMH
    Last edited by bmh; Apr 19th, 2002 at 08:26 AM.

  2. #2
    Hyperactive Member Ambivalentiowa's Avatar
    Join Date
    Apr 2002
    Location
    Coming soon to a store near you!
    Posts
    375
    Just change the field name to one word

    ie Studentid
    -Show me on the doll where the music touched you.

  3. #3
    jim mcnamara
    Guest
    You have a field naming problem. A lot of DBMS packages support field names with hyphens, some do not. Have you tried bracket notation? [my-field] - this gets around a lot of problems with funny characters in field names.

    The VB IDE is what is adding the spaces around the hyphen. YOu can use another editor, then cut and paste the code into the VB IDE. As long as the IDE editro diesn't touch it, the spaces will not be there

  4. #4

    Thread Starter
    Lively Member bmh's Avatar
    Join Date
    Aug 2001
    Location
    Australia (Melbourne)
    Posts
    67
    Hi ....

    This is what i was thought if i cannot find any solutions ...... but the problem i have more then 30 fields with same way of how i was renaming them ..... most of them have "-" between the 2 words ..... and i feel lazy to change the Database and relationships ...... unless i dont have another choice .....


    Did u think there is another solution for this ??


    Thanks alot
    BMH
    Last edited by bmh; Apr 19th, 2002 at 08:37 AM.

  5. #5
    Hyperactive Member Ambivalentiowa's Avatar
    Join Date
    Apr 2002
    Location
    Coming soon to a store near you!
    Posts
    375
    I don't think you haev any choice other than renaming them all. 30 is not a lot.
    -Show me on the doll where the music touched you.

  6. #6

    Thread Starter
    Lively Member bmh's Avatar
    Join Date
    Aug 2001
    Location
    Australia (Melbourne)
    Posts
    67
    jim mcnamara,

    thanks 4 ur answer ..... and i tried to write the code in some HTML Editor .... but it give me the same problem ..... thanks alot



    Ambivalentiowa,

    Realy

    I think today i will not sleep early ..... .... coz i have to finish this application in 48 Hrs ....


    any way thanks every one 4 help ......


    Regards
    BMH

  7. #7
    Fanatic Member
    Join Date
    Feb 2002
    Location
    SE England
    Posts
    732
    just use the following code...


    rstStudent.fields("student-id")

    OR

    rstStudent("student-id")

    OR

    rstStudent.fields("student-id").Value

    OR

    rstStudent.fields(1)

    OR

    rstStudent.fields(1).Value

    OR

    rstStudent(1)

    You get the idea...

    using the ! (Bang) notation is just one way to access the fields collection..
    Leather Face is comin...


    MCSD

Posting Permissions

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



Click Here to Expand Forum to Full Width