|
-
Apr 19th, 2002, 08:17 AM
#1
Thread Starter
Lively Member
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.
-
Apr 19th, 2002, 08:26 AM
#2
Hyperactive Member
Just change the field name to one word
ie Studentid
-Show me on the doll where the music touched you.
-
Apr 19th, 2002, 08:29 AM
#3
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
-
Apr 19th, 2002, 08:33 AM
#4
Thread Starter
Lively Member
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.
-
Apr 19th, 2002, 08:36 AM
#5
Hyperactive Member
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.
-
Apr 19th, 2002, 08:42 AM
#6
Thread Starter
Lively Member
-
Apr 19th, 2002, 09:12 AM
#7
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|