Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 29th, 2004, 02:15 PM
msushelly msushelly is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 5 msushelly User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Validation Rule or Query?

Please bear with me...I'm trying to do something to a database I didn't design and I don't know much about technical terms.

What I am trying to do is compare data as it is being entered into a form with what is already stored in the database, but the comparison is between two separate items on the form and in the database. The data in section A on the form must match data in section A in the database table (so it is filtered??); then the data entered in section B on the form is compared to already existing data in section B in the database for all instances where section A information matches to see if a certain item is already in section B in the database (and if so, an error message needs to be displayed on the form; if not, data entry on the form should be allowed). This second comparison is not to check for duplicates; rather it is to avoid certain combinations of section B data.

So, I am not sure if I need to build a query that needs to be ran before updating or if I need to build a validation rule to check if certain data already exists based upon section A and section B data.

Any suggestions?

TIA

msushelly

Reply With Quote
  #2  
Old January 29th, 2004, 02:24 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
Explain a little more on why you need this. I believe that what you are after can be taken care of with a few tweaks to your relationships between tables and indexing. If possible it would help if you could post your DB with sample data (or put on an FTP site)so that we can look at it and offer correct advice.

S-

Reply With Quote
  #3  
Old January 29th, 2004, 02:48 PM
msushelly msushelly is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 5 msushelly User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
The database is built to track items that need to be repaired on aircraft. Each aircraft system that needs repairs has a unique number assigned to it. Certain items must be repaired immediately; others are deferred and are tracked in our database.

There are systems that cannot be deferred together and our database does not currently flag this. So, on aircraft number 200, we cannot have system X and system Y deferred at the same time, but they can be separately.

What I would like to have happen (and this may not be possible) is the following: as aircraft number 200 is getting a deferred maintenance item entered in a form, the database compares any items currently outstanding on that aircraft and makes sure what item is being deferred can be by checking the unique number to others to make sure there is no conflict. If there is no conflict, the entry can continue. If there is a conflict, then a message needs to pop up to tell the user that this item cannot be deferred because of a conflict.

Reply With Quote
  #4  
Old January 29th, 2004, 02:54 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
Quote:
Originally posted by msushelly
What I would like to have happen (and this may not be possible) is the following: as aircraft number 200 is getting a deferred maintenance item entered in a form, the database compares any items currently outstanding on that aircraft and makes sure what item is being deferred can be by checking the unique number to others to make sure there is no conflict. If there is no conflict, the entry can continue. If there is a conflict, then a message needs to pop up to tell the user that this item cannot be deferred because of a conflict.


This will be hard to explain how so give me a day of 2 and I will send you a sample DB that will do this. Please feel free to ask how it is going.


S-

Reply With Quote
  #5  
Old January 29th, 2004, 03:27 PM
msushelly msushelly is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 5 msushelly User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks so much for your help. I'll be patiently waiting!

Reply With Quote
  #6  
Old February 2nd, 2004, 10:49 AM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
Hey, I didn't have a time to create the sample over the weekend. I will work on it today, but I have included a sample that has ADO and DAO code for you to look at. The sample I will send you will use VBA code.

S-

Reply With Quote
  #7  
Old February 3rd, 2004, 10:52 AM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
Sorry this took so long

Now I didn't give you everything you wanted, becuase it would take even longer

What I have is code that checks

1. To makes sure a maintenace request can be deferred

2. To make sure that there isn't currently a maintenance item already deferred to the specify date for that aircraft

You can use these to simply example to make a more complex checking in your system.

If you need more help please feel free to ask and I will help you fine tune your system if statements

S-

Reply With Quote
  #8  
Old February 3rd, 2004, 11:49 AM
msushelly msushelly is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 5 msushelly User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Sorry I forgot about this!

I guess I forgot to tell you the most important part. My company is using Access 97. Can you convert the file so that I can open it? Access 97 doesn't recognize the database format in the files you posted.

Thanks so much!

Reply With Quote
  #9  
Old February 3rd, 2004, 01:01 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
Here it is in 97 (I think)

Your company really should consider converting to 2000 or to be current 2002.

There is no MS support of 97 and as of the middle of this year there will be no mainstream support from MS for 2000 either. You are leaving your self open to potentail security issues the MS will not fix.

S-

Reply With Quote
  #10  
Old February 3rd, 2004, 03:10 PM
msushelly msushelly is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 5 msushelly User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I hear you on the software update...I work for a bunch of cheapskates.

Anyway, I tried the program and here's what I got. When I opened it, a window popped up stating that the code was converted to my program's current version of Visual Basic. I am getting an error after I try to enter information on the form. I enter data and when I click the update button, I get a window that pops up stating: Compile error: can't find project or library. When I click OK, the code pops up and the following is highlighted in yellow:

Private Sub cmdUpdateDAO_Click()

Also two lines down, this is highlighted in brown:

DAOdb As Database

Help!! I'm looking at the code but I can't figure out why this error is occurring.

Reply With Quote
  #11  
Old February 3rd, 2004, 05:40 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
I understand about the cheapskates

In the VB editor window, Look at tools, references. You should see a reference that is missing. Unselect it and find a different version of that reference.


S-

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Validation Rule or Query?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT