In the AfterUpdate Event for the second combo box, set the values.  I'm
assuming you are trying to auto-populate other text boxes on the form.  For
example, something like:

Private Sub 2ndCombo_AfterUpdate ()
    Dim Address_ID

    Address_ID = delivery address id, however you figure that out

    TxtBoxAddress1 = DLookup("Address1", "tbl_Addresses", "ID = " &
Address_ID)
    TxtBoxAddress2 = DLookup("Address2", "tbl_Addresses", "ID = " &
Address_ID)
    TxtBoxCity = DLookup("City", "tbl_Addresses", "ID = " & Address_ID)
    TxtBoxState = DLookup("State", "tbl_Addresses", "ID = " & Address_ID)
    TxtBoxZip = DLookup("Zip", "tbl_Addresses", "ID = " & Address_ID)
End Sub

HTH,
Toby

----- Original Message ----- 
From: "jezmo_codpiece" <[EMAIL PROTECTED]>
To: <AccessDevelopers@yahoogroups.com>
Sent: Wednesday, July 13, 2005 4:53 AM
Subject: [AccessDevelopers] best way to populate adress fields on a form


> Hi guys, have a form to create a customer quote, and the user has two
> combo boxes, first to pick the customer and then based on which
> customer is chosen the second combo box displays a list of delivery
> addresses. The delivery address id (from a separate delivery address
> table) is poked into a text field as a result of the selection made in
> the second combo box. I would then like to automatically populate the
> rest of the delivery address fields on the form but I am not sure what
> is the best way to do it. I tried to have all the fields selected
> along with the address ID in the combo box, but this was not working
> reliably, it would work for the first address for the first customer,
> but not for any others. I suspect this may be a refresh problem, but I
> am not sure. Is there another more reliable way? Thanks.
>
>
>
>
>
> Please zip all files prior to uploading to Files section.
> Yahoo! Groups Links
>
>
>
>
>
>




Please zip all files prior to uploading to Files section. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AccessDevelopers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to