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 Oct 22, 2002 | 10:28 PM
  #1  
super_si's Avatar
super_si
Thread Starter
Scooby Regular
 
Joined: Feb 2002
Posts: 7,951
Likes: 0
From: Lurkin Somewhere
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]
Reply
Old Oct 22, 2002 | 10:35 PM
  #2  
GaryK's Avatar
GaryK
Scooby Regular
 
Joined: Sep 1999
Posts: 4,037
Likes: 0
From: Bedfordshire
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
Reply
Old Oct 22, 2002 | 10:46 PM
  #3  
MartinM's Avatar
MartinM
Scooby Regular
 
Joined: Jun 1999
Posts: 1,496
Likes: 0
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

Reply
Old Oct 22, 2002 | 10:47 PM
  #4  
super_si's Avatar
super_si
Thread Starter
Scooby Regular
 
Joined: Feb 2002
Posts: 7,951
Likes: 0
From: Lurkin Somewhere
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]
Reply
Old Oct 22, 2002 | 10:51 PM
  #5  
super_si's Avatar
super_si
Thread Starter
Scooby Regular
 
Joined: Feb 2002
Posts: 7,951
Likes: 0
From: Lurkin Somewhere
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
Reply
Old Oct 22, 2002 | 10:54 PM
  #6  
MartinM's Avatar
MartinM
Scooby Regular
 
Joined: Jun 1999
Posts: 1,496
Likes: 0
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...
Reply
Old Oct 22, 2002 | 10:57 PM
  #7  
super_si's Avatar
super_si
Thread Starter
Scooby Regular
 
Joined: Feb 2002
Posts: 7,951
Likes: 0
From: Lurkin Somewhere
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
Reply
Old Oct 22, 2002 | 11:07 PM
  #8  
MartinM's Avatar
MartinM
Scooby Regular
 
Joined: Jun 1999
Posts: 1,496
Likes: 0
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...
Reply
Old Oct 22, 2002 | 11:08 PM
  #9  
super_si's Avatar
super_si
Thread Starter
Scooby Regular
 
Joined: Feb 2002
Posts: 7,951
Likes: 0
From: Lurkin Somewhere
Post

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

save, then back to auto again

bit long winded

Si
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Darrell@Scoobyworx
Trader Announcements
26
Jan 30, 2024 01:27 PM
JimBowen
ICE
5
Jul 2, 2023 01:54 PM
scoobhunter722
ScoobyNet General
52
Oct 20, 2015 04:32 PM
TylerD529
General Technical
2
Oct 9, 2015 01:53 AM
Littleted
Computer & Technology Related
4
Sep 25, 2015 09:55 PM




All times are GMT +1. The time now is 04:47 AM.