In design view of the table, look at the Properties (at the bottom of the page). The first one is called Field Size. When the data type of your field is Text, there will be a number here (Access will default to sometimes 50 and sometimes 255). Enter the max number of characters you want in here. Max is 255 for a text field.
Thanks Ally and Rich
But unfortunately I'm using Access 97 and there doesn't seem to be a field in the properties section with Field Size, is there any alternatives.
Thanks in Advance.
COB
Rich and I both use '97 although it's the same in 2000. In design view of the table, look down near the left hand side and there's two tabs. One called General and the other Lookup. Field Size is the first property under General. If you can't see it, you're probably not in design view of your table!
Even if I could modify the table design, just for an example I had an number which could only be 5 numbers long how could I do that when the options are :Byte Integer, Long int,double etc???
Thanks
Cob
My appologies to you Ally, I didn't mean to cause offense. Blame it on my Irish up bringing.. The text box takes in a a 5 long number and performs mathematical equation on it..
Thanks and Sorry
Cormac
You could work out the lowest (eg 10000) and highest numbers you would ever enter (eg, 99999) and in the Validation Rule (a bit further down on the General properties tab), type:
I found a solution to the problem..
I ended up having to use VBA and converting the textbox value to a string, then finding the length of the string.. It works!!!
Public Function LimitSize()
Dim X
Dim Y
Let X = text1.Text
Let Y = (Len(X))
If Y >= 10 Then
MsgBox "Size limited to 10 characters!!"
End If
End Function