Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Access / Input masking / validation

Thread Tools
 
Search this Thread
 
Old 22 October 2002, 10:28 PM
  #1  
super_si
Scooby Regular
Thread Starter
 
super_si's Avatar
 
Join Date: Feb 2002
Location: Lurkin Somewhere
Posts: 7,951
Likes: 0
Received 0 Likes on 0 Posts
Post

basically i havent got a clue or a hint how to do this.



basically when the type is selected i want the weight limit to change automatically!

But how would do setup the weight limit bit
[edited = I can do this when i setup the VB easy - just i want it setup at the design level]
Si

[Edited by super_si - 10/22/2002 10:34:35 PM]
Old 22 October 2002, 10:35 PM
  #2  
GaryK
Scooby Regular
 
GaryK's Avatar
 
Join Date: Sep 1999
Location: Bedfordshire
Posts: 4,037
Likes: 0
Received 0 Likes on 0 Posts
Post

Si,

If you make the 'type' a combobox then the combo should have an OnChange event where you can then alter the weight textbox value.

It'll be something along those lines anyway, Im not big on access forms

Gary
Old 22 October 2002, 10:46 PM
  #3  
MartinM
Scooby Regular
 
MartinM's Avatar
 
Join Date: Jun 1999
Posts: 1,496
Likes: 0
Received 0 Likes on 0 Posts
Post

I guess what you really mean is that whan you change the Type, the weight of the vehicle can't exceed the max weight for that vehicle type.

Looks like your data model is a bit wrong
Maybe the data model should be ...
VEHICLE has Reg Num and Type_Id and Weight
TYPE (which you don't have) has a Type_Id, Type Name and Weight Limit

..you don't put the Weight Limit on VEHICLE - that's a horrible normalisation to be burdened with

The validation rule is not that simple, but along the lines of

VEHICLE.Weight <= TYPE.Weight Limit WHERE VEHICLE.Type_Id = TYPE.Type_Id

...the validation rule doesn't make anything change on the screen - it just stops the user tabbing away from the field with an incorrect value

HTH

Old 22 October 2002, 10:47 PM
  #4  
super_si
Scooby Regular
Thread Starter
 
super_si's Avatar
 
Join Date: Feb 2002
Location: Lurkin Somewhere
Posts: 7,951
Likes: 0
Received 0 Likes on 0 Posts
Post

like you said thats on the access forms.

I can quite easy do it in VB. Just thought id also program it into the actual database. Just done all the other input masks.

Off to input data and see what works and doesnt

Thanks martyn think ill leave it be
Si

[Edited by super_si - 10/22/2002 10:48:02 PM]
Old 22 October 2002, 10:51 PM
  #5  
super_si
Scooby Regular
Thread Starter
 
super_si's Avatar
 
Join Date: Feb 2002
Location: Lurkin Somewhere
Posts: 7,951
Likes: 0
Received 0 Likes on 0 Posts
Post

Stupid qu time.

How do i reset auto number to 0 again! its on wild numbers like 12 + because all the changes ive being making

Si
Old 22 October 2002, 10:54 PM
  #6  
MartinM
Scooby Regular
 
MartinM's Avatar
 
Join Date: Jun 1999
Posts: 1,496
Likes: 0
Received 0 Likes on 0 Posts
Post

Well, in a proper system you should 'code' it in the database as well, because you can't guarantee that all data input is via your VB forms only...like someone writes a batch load program and writes straight to your database, filling it with vehicle weights that are over the weight limit for the vehicle type

..then you/your database would be in a mess!

BTW it's called DECLARATIVE REFERENTIAL INTEGRITY...go STW to find out more

Good luck...
Old 22 October 2002, 10:57 PM
  #7  
super_si
Scooby Regular
Thread Starter
 
super_si's Avatar
 
Join Date: Feb 2002
Location: Lurkin Somewhere
Posts: 7,951
Likes: 0
Received 0 Likes on 0 Posts
Post

Cheers, i just wanted to setup the database the same as my vb form so its all validated and inputted correct.

Ill play tomrrow with it.

Si
Old 22 October 2002, 11:07 PM
  #8  
MartinM
Scooby Regular
 
MartinM's Avatar
 
Join Date: Jun 1999
Posts: 1,496
Likes: 0
Received 0 Likes on 0 Posts
Post

Stupid qu - not that stupid actually

I don't think you can - apart from deleting the table and re-creating it...but to do that efficiently you need to have your database design as a set of DAO CREATE statements (look in Access Help) rather than using the Access UI to create the tables
...again in a real system, you should be able to re-create your database from a set of scripts if it gets corrupted

Good luck again...
Old 22 October 2002, 11:08 PM
  #9  
super_si
Scooby Regular
Thread Starter
 
super_si's Avatar
 
Join Date: Feb 2002
Location: Lurkin Somewhere
Posts: 7,951
Likes: 0
Received 0 Likes on 0 Posts
Post

cheers i was thinking, just delete relationships change the autonum to normal.

save, then back to auto again

bit long winded

Si
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Darrell@Scoobyworx
Trader Announcements
26
30 January 2024 01:27 PM
JimBowen
ICE
5
02 July 2023 01:54 PM
scoobhunter722
ScoobyNet General
52
20 October 2015 04:32 PM
TylerD529
General Technical
2
09 October 2015 01:53 AM
Littleted
Computer & Technology Related
4
25 September 2015 09:55 PM



Quick Reply: Access / Input masking / validation



All times are GMT +1. The time now is 03:54 AM.