Hello,
I have created a form called frmS2P with the following:
1 listbox called List11 which holds the contents of a query created off
my table called tblRequestActio ns. The fields which the listbox holds
are Request_ID and MoveNumber.
1 text box called Date which is populated with the default value of
=Date( ).
1 combo box called Combo2 which is holds the contents of a query
created off my users table to display the names of managers.
1 button called Submit
I would like this form to allow managers to select multiple items from
the listbox and then use the combo box to pick there name and then
click the submit button.
Once the submit button is clicked I would like it to go find the table
tblRequestActio ns and populate the records that have been choosen in
the listbox by finding the Request ID in that table and updating the
DateSubmitted and SubmitAuthorize dBy fields with the contents of the
Date text box and Submitted By Combo2 box.
I have started on my own to write this code with help from searching
around and I can't figure out how or where to add the Date field in and
why it is not reading the field SubmitAuthorize dBy in the
tblRequestActio ns. I keep getting an error of method or data member not
found.
The code I have so far is:
Private Sub cmdSubmit_Click ()
Dim db As DAO.Database
Dim rst As DAO.Recordset
If Me.List11.Items Selected.Count = 0 Then
MsgBox "No items selected. Update operation aborted."
Exit Sub
End If
Set db = CurrentDb
Set rst = db.OpenRecordse t("tblRequestAc tions")
rst.Index = "Request_ID "
For Each itm In Me.List11.Items Selected
rst.Seek "=", Me.List11.ItemD ata(itm)
rst.Edit
rst.SubmitAutho rizedBy = Me.Combo2
rst.Update
Next
rst.Close
Set rst = Nothing
Set db = Nothing
End Sub
Could someone please point in the right direction here??
Thanks,
Justine