Limit number of characters in field

  • Thread starter Thread starter Phil
  • Start date Start date
P

Phil

Hi,

I have a table with 1 field (text, 20 characters) and 8
records. I also have a continious form which shows the 8
records (no adds or deletes allowed) and I want the user
to be able to change the data in each record. My problem
is that I want to restrict the number of characters in
records 1 & 2 to 10 characters, records 3 & 4 to 15
characters and records 5 - 8 to 20 characters.

I know that this can be done but I don't know how.

Any help would be appreciated.

Thanks,
Phil
 
Hi,

I have a table with 1 field (text, 20 characters) and 8
records. I also have a continious form which shows the 8
records (no adds or deletes allowed) and I want the user
to be able to change the data in each record. My problem
is that I want to restrict the number of characters in
records 1 & 2 to 10 characters, records 3 & 4 to 15
characters and records 5 - 8 to 20 characters.

Since Access tables HAVE NO ORDER, and don't have "record numbers",
the problem as stated is insoluble.

You will - at the least - need to add a new field to the table. This
could contain an integer record number that you would maintain
yourself, or perhaps it could contain the allowed number of characters
in the field. You could then use VBA code in the form textbox's
BeforeUpdate event to disallow input above the allowed size.


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Back
Top