Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

comparing two tables based on two identical fields

Posted on 2007-12-04
10
Medium Priority
?
445 Views
Last Modified: 2013-11-27
Tables:  Details, Index
Fields:  FileName, FileDate

What I would like to do is step through each record in Details, when the FileName data is identical between the two tables, the word "Present" is stored in Index.FileStatus and moves onto the next record to check.  When Details has a FileName that doesn't compare to Index, the word "Missing" is stored in Index.FileStatus and moves onto the next record to check.  When Index has a FileName that doesn't compare to Details, then that FileName, FileDate, and AppDetails (query) is run and moves onto the next record to check.  

I hope this is enough information. I appreciate any help you can provide.  I have a deadline tomorrow and this is the last piece to implement into the rest of my code and test.  Thank you.
0
Comment
Question by:mastro78
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
10 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 2000 total points
ID: 20410354
Using a query is the simplest approach to the first part of this.
I don't understand the third bit and the second bit doesn't make sense.

QrySetPresent:

Update [Index] inner join [Details]
on Index.filename = Details.Filename
Set Index.Filestatus = "Present"

You then say 'When Details has a FileName that doesn't compare to Index, the word "Missing" is stored in Index.FileStatus'
So you want to set Index.FileStatus to 'Missing' if the record is not present in Index.  So which record in Index would you be setting to this value?

As I said I don't understand what you want to do in the third step.
0
 

Author Comment

by:mastro78
ID: 20410548
Actually I mistyped, there will be no need for that piece.
0
 

Author Comment

by:mastro78
ID: 20410563
I do have another question off topic, what is the best way to store data using a function?  I currently have a function where I'm calculating and then calling it using a text box source (ie =GetCalc).  What would be a better way of doing that so that when I open up my form, the calculation is already in place in the field.  Just a general answer will do...or if you need my code I can provide that as well.
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
LVL 77

Expert Comment

by:peter57r
ID: 20410693
If you have a calculated control it should produce the answer as soon as you open the form.
It should recalculate as you navigate from record to record or if you change any value in the record used by the calculation.  Is that not happening for your control?



0
 

Author Comment

by:mastro78
ID: 20410733
The calculation works, but I want to store it each time since the factors that effect that control don't change too often so I'm running unnecessary calculations.
0
 
LVL 77

Expert Comment

by:peter57r
ID: 20410815
If the calculation is correct at all times then you should probably leave it as a calculated value.
One possible reason for storing the value would be the need to know what the value was when it was previously calculated, because the value might be calculated differently now. Another might be that the calculation involves processing 10's of thousands of records.
Otherwise don't store it.  If you do,  you can have my personal guarantee that one day the saved answer will be wrong because one of the values used in the calculation has changed but the stored answer hasn't(:-)



0
 

Author Comment

by:mastro78
ID: 20410883
True.  I was debating on whether or not to.
0
 

Author Comment

by:mastro78
ID: 20410899
I've been messing with my application to call items in different places and have basically screwed it up.  Would you mind taking a look at my code for me?  Or should i open up another question?
0
 
LVL 77

Expert Comment

by:peter57r
ID: 20410947
I think you start another Q.  Then you will get more people looking at it.
0
 

Author Closing Comment

by:mastro78
ID: 31412696
Always very helpful
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question