Advertisement

05.04.2008 at 10:57AM PDT, ID: 23375086
[x]
Attachment Details

Textbox entry to retrieve associate table values

Asked by oollu in Access Forms, Microsoft Access Database, VB Database Programming

Tags: , , ,

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!!!


Start Free Trial
Attachments:
 
Bmp of the top of my form
Bmp of the top of my form
 
 
Bottom of my form
Bottom of my form
 
 
Loading Advertisement...
 
[+][-]05.04.2008 at 11:13AM PDT, ID: 21496420

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.04.2008 at 12:21PM PDT, ID: 21496667

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.04.2008 at 12:38PM PDT, ID: 21496708

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.04.2008 at 01:19PM PDT, ID: 21496806

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.04.2008 at 01:44PM PDT, ID: 21496875

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.06.2008 at 09:14AM PDT, ID: 21508557

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.06.2008 at 06:17PM PDT, ID: 21512443

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.06.2008 at 06:42PM PDT, ID: 21512537

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.07.2008 at 07:21AM PDT, ID: 21516655

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Forms, Microsoft Access Database, VB Database Programming
Tags: Microsoft, Access, 2003, On W2K platform
Sign Up Now!
Solution Provided By: GRayL
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.11.2008 at 11:43AM PDT, ID: 21543150

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.11.2008 at 12:53PM PDT, ID: 21543294

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.11.2008 at 01:49PM PDT, ID: 21543443

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 01:16PM PDT, ID: 21550170

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628