How to: update existing contact info on form

A

AA

Hello All,

I need advice on how to update existing contact info on form and save it
with my little experience in access programming I’m having trouble,

here is the form code (was done by a different IT person)

Option Compare Database

Private Sub Find_Click()

End Sub

Private Sub Last_Name_BeforeUpdate(Cancel As Integer)

End Sub

Private Sub Last_Name_GotFocus()

End Sub

Private Sub Last_Name_NotInList(NewData As String, Response As Integer)

End Sub

Private Sub Buiilding_BeforeUpdate(Cancel As Integer)

End Sub


Private Sub cboContact_AfterUpdate()

Dim ContactID As String
Dim rst As DAO.Recordset
ContactID = "SELECT * FROM Contacts " & " WHERE ContactName = '" _
& Me!cboContact.Value & "'"
Set rst = CurrentDb.OpenRecordset(ContactID, dbOpenDynaset)
If rst.EOF = True And rst.BOF = True Then
Call MsgBox("The Contact Name you entered does not exist")
Else
Me!Telephone = rst!Telephone
Me!TbxFax = rst!Fax
Me!TbxComp = rst!Company
Me!TbxFloor = rst!Floor
Me!TbxStreet = rst!Street
Me!TbxCityStateZip = rst!CityStateZip
Me!TbxEmail = rst!email
Me!TbxAcctMgr = rst!Manager
End If

Set rst = Nothing

End Sub
Private Sub Close_Click()
DoCmd.Close
End Sub
Private Sub Form_Load()

'Set Record Source for Forms as Contacts Table
Forms!Contacts.RecordSource = "Contacts"

End Sub
Private Sub Product_Department_AfterUpdate()

End Sub

Private Sub Product_Department_BeforeUpdate(Cancel As Integer)

End Sub

Private Sub Product_Department_Exit(Cancel As Integer)


End Sub
Private Sub Update_Contact_Click()

End Sub

thank you..

AA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top