Form; autopopulate fields

Warbuckle

New member
Local time
Today, 13:30
Joined
Dec 7, 2002
Messages
8
Hello All,

I have a form that generates a Waybill for a courier company. I wish to have the details autopopulate depending on the "customer" chosen from a dropdown combo box.

Details being these fields,

Address
City
Province


etc...................

Thanks in advance.

Will
 
Will,

In the AfterUpdate event on your combo:

' *************************
Dim dbs As Database
Dim rst As Recordset
Dim sql As String

Set dbs = CurrentDb
sql = "Select * from MyTable Where Customer = "'" & _
Me.YourCombo & "'"
Set rst = dbs.OpenRecordset(sql)
If rst.EOF and rst.BOF Then
' New customer, Add new ones manually ...
Else
Me.Address = rst!Address
Me.City = rst!City
Me.Province = rst!Province
End If
' **************************

hth,
Wayne
 
Thank-you,

I will try this method. Juggling 3 clients the last week and learning on the fly so to speak............lol.
 

Users who are viewing this thread

Back
Top Bottom