I have a function for updating 2 tables and i have to enumerate all the fileds in the function.Is there any way to update all in the table
and thus simplify my function.I want to use this function for other similar cases and it will be very conventient just to give the command
for updating without bothering about the fileds.
Mu function is :
Public Function UpdateCallsClients()
Dim sql As String
sql = ” UPDATE CallsClients1 INNER JOIN CallsClients ON [CallsClients1].[CallID]=[CallsClients].[CallID] SET” & _
” CallsClients.FirstName = [CallsClients1].[FirstName] ” & _
” , CallsClients.LastName = [CallsClients1].[LastName] ” & _
” , CallsClients.Address= [CallsClients1].[Address] ” & _
” , CallsClients.city = [CallsClients1].[city] ” & _
” , CallsClients.CompanyName = [CallsClients1].[CompanyName] ” & _
” , CallsClients.title = [CallsClients1].[title] ” & _
” , CallsClients.WorkPhone = [CallsClients1].[WorkPhone] ” & _
” , CallsClients.WorkExtension = [CallsClients1].[WorkExtension] ” & _
” , CallsClients.MobilePhone = [CallsClients1].[Mobile] ” & _
” , CallsClients.EmailName = [CallsClients1].[EmailName] ” & _
” , CallsClients.LastMeetingDate = CallsClients1.LastMeetingDate ” & _
” , CallsClients.ContactTypeID = CallsClients1.ContactTypeID ” & _
” , CallsClients.ReferredBy = CallsClients1.ReferredBy ” & _
” , CallsClients.Notes = CallsClients1.Notes ” & _
” , CallsClients.CallDate = CallsClients1.CallDate ” & _
” , CallsClients.CallTime = CallsClients1.CallTime ” & _
” , CallsClients.subject = CallsClients1.subject ” & _
” , CallsClients.clientID = CallsClients1.ClientID ”
CurrentDb.Execute sql
End Function