473,506 Members | 13,088 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validation by looking into an existing table

6 New Member
Hi all,

i have the following table:

classID (autonumber and PK)
dateOfClass
className
time
studio (choice of two studios)
instructor (FK)

if i had a form of added a new class, i would like an error message appears if a class is doubled book in the same studio and time with instructor on a specific date.

any help

many thanks all

Tej
Feb 13 '08 #1
6 1412
Khriskin
20 New Member
(Note: I'm keeping this vague as it sounds like you are posting homework questions (per your other post). If this is not the case, I apologize!)

Are you checking for duplicates against just [dateOfClass] and [time], or against [instructor] as well?

If it's just the first two, an easy check would be to use a DLOOKUP for one of the variables using the other one as the filter. Then you could check the DLOOKUP output to see if any matches were found.

If you need all three fields, you would probably have to setup a query that looks to the form for data to match. Then just DLOOKUP the query (as above) and see if any matches were found.

Hope that helps! ^_^
Feb 13 '08 #2
Tej21
6 New Member
(Note: I'm keeping this vague as it sounds like you are posting homework questions (per your other post). If this is not the case, I apologize!)

Are you checking for duplicates against just [dateOfClass] and [time], or against [instructor] as well?

If it's just the first two, an easy check would be to use a DLOOKUP for one of the variables using the other one as the filter. Then you could check the DLOOKUP output to see if any matches were found.

If you need all three fields, you would probably have to setup a query that looks to the form for data to match. Then just DLOOKUP the query (as above) and see if any matches were found.

Hope that helps! ^_^

Hey

This is not homework questions - its for my dissertation. Just having a few problems. Creating a database for a sports centre.

Never used the DLOOKUP before but i'll have a go. When I do add new classes in, and look at all current classes available, i do see duplicates, such as:

- two classes happening in the same studio at the same time on the same date with the same instructor!

I will have a go, just cleaning up the db, applying my UI, just needed help on validation.

Cheers

Tej
Feb 13 '08 #3
Khriskin
20 New Member
My mistake about the homework, sorry about that! ^_^;; <-(sheepish look) ((baa!!)

I use isnull(DLOOKUP) combo as a fast way to check and see if a query returns empty, but there are probably better ways out there.

isnull(DLOOKUP("[Field1]", "tblData")) will spit out true if there is no data in tblData (assuming you change [Field1] to a field the query returns) and false if there is. Since the query will only return records that are in conflict, then all you need to know if that the query is empty. ^_^
Feb 13 '08 #4
missinglinq
3,532 Recognized Expert Specialist
Nothing to apologize for, Martha! A dissertation is homework! Fancy homework, but homework neverless!

Linq ;0)>
Feb 13 '08 #5
Scott Price
1,384 Recognized Expert Top Contributor
I agree with Linq, Martha. Your answer is spot on (as they might say in England or Australia, can't remember which LOL)! We don't provide copy-n-paste answers for homework.

As a dissertation, this is still considered under the guidelines of 'homework', however nothing in this thread has violated our posting guidelines. Good work to both of you. To the OP (Original Poster) for wanting to learn and asking a question that will help you learn. To Martha for answering in a way that will require thought.

Regards,
Scott
Feb 13 '08 #6
Tej21
6 New Member
Obviously I dont want a copy n paste answer - wheres the learning aspect in that?

I will try and figure out with what i have learnt here, and will get back to you all.

Thanks

Tej
Feb 13 '08 #7

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

Similar topics

18
9006
by: Steve | last post by:
Hi I have a really weird problem and any assistance would be welcome. I have developed an app in Access 2002. The app runs perfectly on the development machine. I have packaged the app using...
2
2356
by: Vladi | last post by:
Experience is highly requested. I can't find solution for the following problem: I am making VBA code for moving/modifying data from "old" tables into "new" ones. In fact, this is part of the...
3
2322
by: Rob Meade | last post by:
Hi all, I have a login page which has username and password fields, a login button, and 2 validation controls (one for each field) - currently I have controls to display to the summary if the...
2
2670
by: Dnna | last post by:
I have a table which is bound to an Internet Explorer XML data island. I'm using ASP.NET's client-side validators for an input field in the table. The problem is that if the input fields are in...
5
1912
by: Sun Jian | last post by:
Hi, I am trying to customize the asp.net validation to achieve the following: Upon submitting the form, client side validation will run, and it will stop at the first error detected. For...
3
6316
by: Bob Alston | last post by:
I have a routine to copy data to new versions of my app via insert into sql statements. Unfortunately, due to evolution of my app, sometimes the new version has more restrictive editing than an...
12
2035
by: Dabbler | last post by:
I need to insure that at least one of three phone number fields has a value (requiredfield) but I'm not sure of a way to implement this without server side logic. Is there a way to use the...
0
1224
by: auxvivrespos | last post by:
I am using Access 2003 and I have built a simple little database to keep track of invoices that are received at my office. I have created a "Suppliers" table which is a list of the companies from...
3
5125
by: babamc4 | last post by:
Hi Experts, I have just completed designing a new DB and my boss has asked me to put some complicated (I think!) validation rules on to it. My table is below: 1. Index - Autonumber 2....
18
6194
by: ChipR | last post by:
I have a text box with a validation rule and validation text. When entering a new record, if I put in invalid text, the validation text is displayed in a message box, but after clicking OK, another...
0
7220
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7105
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7308
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5037
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1534
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.