Question : Autopopulate 2 fields on the same form from same table

Hi all,
I need to know how to populate customer account no and name on a form.
The form is called frmManifest, and I have two fields. One is account no, and the other is customer name.
I need when account no is selected, it will also populate the customer name field automatically. Both data would be retrieved from tblCustomer.
I'm also having a similar problem with field Destination and Terminal on the frmManifest. In which, if destination is selected, it would retrieve the corresponding data from tblManifest and fill in both field Destination and Terminal.
I've put my db up on site for download. Its best one looks at it to get an idea, its quite simple.
http://www.w-projects.net/courier/courier3.zip
(file has been checked and is virus free)

For the record, my email is jmanson AT w-projects.net

Thankyou in advance


Answer : Autopopulate 2 fields on the same form from same table

John

Heres your code for the dropdown for destination. secting the destination automatically populates both zoneID and terminalID


Private Sub cboSvcArea_Change()
 strZoneID = DLookup("[ZoneID]", "tblSvcAreas", "[SvcAreaID] =" &
Me.cboSvcArea.Column(0))
 Me.ZoneID = strZoneID
 Me.TerminalID = DLookup("[TerminalID]", "tblZones", "[ZoneID] =" & "'"
& strZoneID & "'")
 Me.Refresh
End Sub

Private Sub Command39_Click()

End Sub

Private Sub Form_Load()
  'Me.Recordset.AddNew
End Sub

Jiohn
Random Solutions  
 
programming4us programming4us