Do not use on any
shared computer
August 29, 2008 11:11pm pdt
 
[x]
Attachment Details

Textbox entry to retrieve associate table values

Tags: Microsoft, Access, 2003, On W2K platform
I have a form which has five different "areas" on it where  the user enters information.  The first 'area' is a combo box (created via the wizard) where the user selects a customer name and that populates the proper address info.  

The next two 'areas' have a text field where the user enters a string.   I need each one to perform a specific query (or something) associated with the manually entered value. The fields are labeled ACM# and melt #.  In other words, the user types in a string, presses the Tab key,  then the query  associated with that entered string will execute, and it will display the relevant results in the associated textboxes on the form.  Each of the 'search' text boxes is unbound.  Each 'area' is assiciated with it's own table.  I'm not really sure what I should be using as the main forms  Record Source.  Currently, I have used the query builder to include all necessary tables (there are  and fields.  

The first text field ACM # is associated with the Customer Requirements table.  The second text field (Melt #) is contained within a subform called Chemical Analysis which will be associated with the next subform called Chemical Requirements.  Chemical Analysis is associate the the ChemResults table and Chemical Requirements is associated the the ChemRequirements table.  Upon the user entering the Melt # I need a query to execute where it retrieves the appropriate values from both tables and populates the correct subform.  

The company I work for does not want to use any type of command button, so this is why I believe I need to use the After Update event.  I can not link this CustomerName to the rest of the form, because there will be many products (first textbox) etc associated with this specific customer.  There are similar reasons for the other 'areas'  And my employer does not want drop downs for these other values that the user will manually enter the string.

I am attaching a 2 bmp's of my existing form.  I originally put in three subforms, but I do not know if I can accomplish this without using subforms.  

Here is a code snippet of something I have tried, but it does not return the correct values, and, if the form is blank, it returns nothing.

Private Sub txtACM_AfterUpdate()
    Dim db As DAO.Database
    Dim qdf As DAO.QueryDef
    Dim strSQL As String
    Set db = CurrentDb
    Set qdf = db.QueryDefs("qryACM")
    strSQL = "SELECT CustomerRequirements.* " & _
             "FROM CustomerRequirements " & _
             "WHERE CustomerRequirements.ACM = '"" & Me.ACM & ""' "
             
    qdf.SQL = strSQL
    DoCmd.OpenQuery "qryACM"
   
    Debug.Print strSQL
   
End Sub

Any help on this would be greatly appreciated.  I am obviously not a great programmer, so this is driving me (and my employer) nuts!!   Thank you ahead of time!!!


Attachments:
 
Bmp of the top of my form
Bmp of the top of my form
 
 
Bottom of my form
Bottom of my form
 
Start your free trial to view this solution
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Question Stats
Zone: Microsoft
Question Asked By: oollu
Solution Provided By: GRayL
Participating Experts: 1
Solution Grade: A
Views: 37
Translate:
Loading Advertisement...
 
[+][-]Expert Comment by GRayL

Rank: Genius

Expert Comment by GRayL:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by oollu
Author Comment by oollu:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by oollu
Author Comment by oollu:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by GRayL

Rank: Genius

Expert Comment by GRayL:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by oollu
Author Comment by oollu:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by oollu
Author Comment by oollu:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by GRayL

Rank: Genius

Expert Comment by GRayL:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by oollu
Author Comment by oollu:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Accepted Solution by GRayL

Rank: Genius

Accepted Solution by GRayL:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by oollu
Author Comment by oollu:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by GRayL

Rank: Genius

Expert Comment by GRayL:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by oollu
Author Comment by oollu:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by GRayL

Rank: Genius

Expert Comment by GRayL:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080723-EE-VQP-34 / EE_QW_2_20070628