I will try that and let you know. Thanks
Main Topics
Browse All TopicsI have the form load event where this code works fine to add employees to the recordset. See form load code.
However, the problem is that the tbl_Personnel and tbl_Appointments are not related to each other in the relationships of the database.
So when I update the tbl_Personnel it does update on the appointment book but all the past and present appointments disappear . In other words I need to find a sql statement that will loop through the recordset and update the employee names in the database, otherwise the appts never will show up on the appt book.
What statement should I use to update the tbl_Appointments so that "employee" name is updated when the user wants to edit the name on the form? I have tried to use a join on the form load but that does not seem to update and the names do not appear on the form in the employee FirstName, LastName txtboxes. when I use :
adoprimaryrs.Open "SELECT tbl_Appointments.Index AS tbl_Appointments_Index, tbl_Appointments.Employee,
--------------------------
I have for update:
adoprimaryrs.UpdateBatch adAffectAll
If mbAddNewFlag Then
adoprimaryrs.MoveLast 'move to the new record
End If
mbEditFlag = False
mbAddNewFlag = False
SetButtons True
mbDataChanged = False
Exit Sub
UpdateErr:
MsgBox Err.Description
End Sub
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: anilallewarPosted on 2009-06-15 at 08:32:03ID: 24629877
Try
Update tbl_Appointments
set personalid(whatever your key is)= a.new key
from tbl_Appointments a INNER JOIN tbl_Personnel b ON tbl_Appointments.Index = tbl_Personnel.Index
where a.index= (whatever your new value is)
If you updating the defination column..you need first update tbl_Appointments with new value and then tbl_Personnel