Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > Courses > Access > Expert > X01 > < B9 | X02 >
Back to Access Expert 1    Comments List
Upload Images   Link   Email  
Filtered Data in Form
David Harrington 
      
2 years ago
I am trying to avoid storing calculated data in my table.

I have a hex grid map
Each record in my Map table is a unique hex and the fields store various properties of this hex.

As example:  Within the record I store TerrainID, TerrainModID, SettlementId from 3 different linked tables.

I could create a field which is a DLookup calculation based on properties in the Terrain, TerainMod, and Settlement tables.  This seems poor practice and I am looking for a better way.

Instead, I have created a query with the relevant data and do the calculations within the query.

MY PROBLEM:  I cannot filter the query to the correct record and pull this calculated field back display in my form.

Suggestions?

Alex Hedley 
            
2 years ago
> I cannot filter the query to the correct record and pull this calculated field back display in my form.

Can you share the SQL you've tried?
David Harrington OP 
      
2 years ago
Hi Alex:  Here is the SQL for the QUERY.  It seems to be working fine when I open the query

SELECT tblLocationsGrandTacticalHex.GTHexID, tblLocationsGrandTacticalHex.TerrainID, tblMapStatTerrain.MaxProvinceLevel, tblLocationsGrandTacticalHex.TerrainModID, tblMapStatTerrainModifiers.ProvinceLevelModifier, [maxprovincelevel]+[provincelevelmodifier] AS HexMaxDevValue, tblMapStatTerrain.MaxAuraLevel, tblMapStatTerrain.MaxAuraLevel AS HexMaxAuraValue
FROM tblMapStatTerrain INNER JOIN (tblMapStatTerrainModifiers INNER JOIN tblLocationsGrandTacticalHex ON tblMapStatTerrainModifiers.TerrainModID = tblLocationsGrandTacticalHex.TerrainModID) ON tblMapStatTerrain.TerrainID = tblLocationsGrandTacticalHex.TerrainID;

I use two combo boxes within the form

HexMaxDevValue has this:
row source         SELECT [qryMaxHexDevYAura].[GTHexID], [qryMaxHexDevYAura].[HexMaxDevValue] FROM qryMaxHexDevYAura;
control source     HexMaxDevValue  which is a field in 'tblLocationsGrandTacticalHex.

HexMaxAuraValue has this
row source        SELECT [qryMaxHexDevYAura].[GTHexID], [qryMaxHexDevYAura].[HexMaxAuraValue] FROM qryMaxHexDevYAura;
control source    HexMaxAuraValue  which is a field in 'control source HexMaxDevValue  which is a field in 'tblLocationsGrandTacticalHex.


The form only updates when I move off the record and then return
The tblLocationsGrandTacticalHex is not updating at all
Richard Rost 
          
2 years ago
Those table/field names hurt my eye. Simplify it, please. All I see is a jumble of letters.
David Harrington OP 
      
2 years ago
Hi Richard
Having grown up with QBasic and the single letter cryptic variable names, I have now fully embraced long cryptic variable names.

Monitors give us enough eye stain without me adding to the problem.  Hopefully this is better!  I've attempted to use your T and Q suffixes for readability.

SELECT LocationT.HexID, LocationT.TerrainID, TerrainT.DLevel, LocationT.TerrainModID, TerrainModT.DModifier, [Dlevel]+[DModifier] AS MaxDValue, TerrainT.ALevel, TerrainT.ALevel AS MaxAValue FROM TerrainT INNER JOIN (TerrainModT INNER JOIN LocationT ON TerrainModT.TerrainModID = LocationT.TerrainModID) ON TerrainT.TerrainID = LocationT.TerrainID;

I use two combo boxes within the form

MaxDValue has this:
row source:     SELECT [DandAQ].[HexID], [DandAQ].[MaxDValue] FROM DandAQ;
control source:     MaxDValue which is a field in 'LocationT.

MaxAValue has this
row source:     SELECT [DandAQ].[HexID], [DandAQ].[MaxAValue] FROM DandAQ;
control source:     MaxAValue which is a field in LocationT.

The form only updates when I move off the record and then return
The LocationT is not updating at all
David Harrington OP 
      
2 years ago
Hi Richard and Alex:
I have found my problem.  I was doing an after_update requery event, but on a dirty record.  I added a me.refresh above the requery and all is well.

David

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Expert 1.
 

 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2025 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 2/15/2025 12:54:40 AM. PLT: 1s