AutoUpdate

  • Thread starter Thread starter Candi Cain
  • Start date Start date
C

Candi Cain

Help! I spent 4 years building databases, then left the workforce for nearly
2 years and am now back at it....i've found out the 'use it or lose it'
theory is true!

I have a table(Customers) containing the following two fields:
Customer
Contact

I have a form based on a separate table(Quote History). I want the fom to
display fields from the above table. When a user selects a Customer fom the
combo box on the form, I would like the Contact field to automatically
populate. I've tried everything I can think of...I know it's one minor
detail I am missing, but it's killing me.

My latest attempt was a query...combining my two tables, joined by
customer...selecting customer from the quote table and contact from the
customer table..no luck...

I am using XP

What is my missing link?
Thanks!!
Candi
 
You relationship must contain the primary key from the Quote History table,
the one side of the relationship, and a column in your Customers table with
the same datatype, the many side of the relationship. IE.. One Quote
History with many customers. Once you have done that, you make a query with
both tables. Add all the columns you want from Quote History, and both
columns from Customers. When you make your selection from the dropdown, it
will show that customers contact. Let me know if this doesnt work. If it
doesnt work there is something wrong with the relationship or the query, so
please post how you have your relationship set up.
 
Ugh! I am so frustrated.

My form(Quote form) is based on a table (Quote table). All of the fields
from the Quote table are on the form. The properties of the customer field
are:

Combo Box
Row Source Type: Table/Query
Row Source: SELECT [Tbl-Customer].[Customer Name] FROM [Tbl-Customer]

Based on the selection from this drop down list, I would like the Contact
field on my form to automatically populate. The Customer and Contact names
are stored in the Customer table.

The customer also needs to be stored in the Quote table.

I need the opposite of what you suggested...I have many quotes for one
customer.....

Hope this helps!!
 
This is what I am trying to accomplish:

A typical example of this is getting state and city name from Zipcodes. If
you have a Zip-Code table, you'll never have to enter the State/City again.
Add this simple code in the OnExit() event-handler for the field containing
the Zipcode.

'************* Code Start **************
' This code was originally written by Erika Yoxall.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Erika Yoxall
'
Sub Zip_OnExit(Cancel As Integer)
Dim varState, varCity As Variant
varState = DLookup("State", "tblZipCode", "ZipCode =[Zip] ")
varCity = DLookup("City", "tblZipCode", "ZipCode =[Zip] ")
If (Not IsNull(varState)) Then Me![State] = varState
If (Not IsNull(varCity)) Then Me![City] = varCity
End Sub
'************* Code End **************
However, the code and the strings mean nothing to me. When I have done this
in previous databases, I have used a macro or query. (as far as I can
remember)
 
Back
Top