L
ladybug via AccessMonster.com
I am trying to modify an existing database. There is a form with a subform.
I have added a combo box at the bottom of the main form called
txt_add_employee. I want the user to be able to make a selection in the
combo box and then click a button called btn_add_employee. This On Click
Procedure is supposed to add that selection (employee)to the list in the
subform.
Here is what I have right now in the Event Procedure behind the On Click
Button:
DoCmd.SetWarnings False
DoCmd.RunSQL ("INSERT INTO tbl_Attendees (Employee_ID) SELECT " & Chr(34) &
Forms!frm_Meeting!txt_add_employee & Chr(34))
Forms!frm_Meeting!sfrm_Attendees!Employee_ID.Requery
Nothing happens when a selection is made in the combo box and the
btn_add_employee is clicked.
The record source behind the form is:
SELECT tbl_Meeting.Meeting_ID, tbl_Meeting.Meeting_Date, tbl_Meeting.
Meeting_Type_ID FROM tbl_Meeting;
The record source behind the subform is:
SELECT tbl_Attendees.Attending_Meeting_ID, tbl_Attendees.Meeting_ID,
tbl_Attendees.Employee_ID, tbl_Employee.Employee FROM tbl_Attendees INNER
JOIN tbl_Employee ON tbl_Attendees.Employee_ID=tbl_Employee.Employee_ID ORDER
BY tbl_Employee.Employee;
The row source of txt_add_employee is:
SELECT tbl_Employee.Employee_ID, tbl_Employee.Employee FROM tbl_Employee;
Can someone please help?
I have added a combo box at the bottom of the main form called
txt_add_employee. I want the user to be able to make a selection in the
combo box and then click a button called btn_add_employee. This On Click
Procedure is supposed to add that selection (employee)to the list in the
subform.
Here is what I have right now in the Event Procedure behind the On Click
Button:
DoCmd.SetWarnings False
DoCmd.RunSQL ("INSERT INTO tbl_Attendees (Employee_ID) SELECT " & Chr(34) &
Forms!frm_Meeting!txt_add_employee & Chr(34))
Forms!frm_Meeting!sfrm_Attendees!Employee_ID.Requery
Nothing happens when a selection is made in the combo box and the
btn_add_employee is clicked.
The record source behind the form is:
SELECT tbl_Meeting.Meeting_ID, tbl_Meeting.Meeting_Date, tbl_Meeting.
Meeting_Type_ID FROM tbl_Meeting;
The record source behind the subform is:
SELECT tbl_Attendees.Attending_Meeting_ID, tbl_Attendees.Meeting_ID,
tbl_Attendees.Employee_ID, tbl_Employee.Employee FROM tbl_Attendees INNER
JOIN tbl_Employee ON tbl_Attendees.Employee_ID=tbl_Employee.Employee_ID ORDER
BY tbl_Employee.Employee;
The row source of txt_add_employee is:
SELECT tbl_Employee.Employee_ID, tbl_Employee.Employee FROM tbl_Employee;
Can someone please help?