By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 1,302 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

Changing column property through VB Code

P: 1
Dear All,
I have a request that I am working with vb. What all I need is, Using a vb form am trying to change a field property of Access table ie. i want to change the property "Allow Zero Length" in to "Yes" by default it is 'NO".
when i am using like tb1.fields(1).Allow zero length = Yes , it shows error
So, Any one can give me a solution.
Thaks,
Musthafa
Sep 5 '07 #1
Share this Question
Share on Google+
6 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
Dear All,
I have a request that I am working with vb. What all I need is, Using a vb form am trying to change a field property of Access table ie. i want to change the property "Allow Zero Length" in to "Yes" by default it is 'NO".
when i am using like tb1.fields(1).Allow zero length = Yes , it shows error
So, Any one can give me a solution.
Thaks,
Musthafa
If tb1 is a TableDef object?

Assuming it is then

tb1.Fields(1).AllowZeroLength = True

should work.
Sep 5 '07 #2

P: 9
If he wants to allow zero length then shouldn't the allow zero length property be set to true?
In other words...

tb1.Fields(1).AllowZeroLength = True

Or am I misunderstanding? ><
Sep 5 '07 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
If he wants to allow zero length then shouldn't the allow zero length property be set to true?
In other words...

tb1.Fields(1).AllowZeroLength = True

Or am I misunderstanding? ><
My apologies, you are of course correct. I've edited my post accordingly
Sep 5 '07 #4

Robbie
100+
P: 180
In other words, the values are True and False, rather than Yes and No.
Sep 5 '07 #5

P: 9
Exactly. Basically it's Boolean values. Boolean means that it can only be one thing or the other(kinda like on and off). From what you said Access seems to handle booleans with yes and no values, while VB, like most programming languages, handles it with true or false.

on=yes=true
off=no=false

Mmccarthy- lol, thanks. That had me a bit confused.
Sep 6 '07 #6

MMcCarthy
Expert Mod 10K+
P: 14,534
Exactly. Basically it's Boolean values. Boolean means that it can only be one thing or the other(kinda like on and off). From what you said Access seems to handle booleans with yes and no values, while VB, like most programming languages, handles it with true or false.

on=yes=true
off=no=false

Mmccarthy- lol, thanks. That had me a bit confused.
No problem. Glad you got it working.
Sep 6 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.