Recent content by desjardins

  1. D

    Error with DoCmd.RUNSQL Update code

    I will try to take a look at this tomorrow. I don't know where you are but it's Friday night here :)
  2. D

    Error with DoCmd.RUNSQL Update code

    I think you are missing some spaces. Also, I'm not sure if SET is case sensitive in SQL. Try this: DoCmd.RunSQL "UPDATE [Timers] SET [Worker_Time] = " & Me.TotalTime01 & " WHERE [Timers].[Worker_Code] = " & 1
  3. D

    Error with DoCmd.RUNSQL Update code

    What is the & 1 for? Are you trying to increment the time by one? or the worker code by one?
  4. D

    Need to select from listbox and open form to that record

    Well, now it's sort of working. There's a problem in this section: rst.FindFirst strSQL If Not rst.NoMatch Then frm.Bookmark = rst.Bookmark Else MsgBox "No Match Available" End If The first time I choose someone from the listbox, the msg box pops up with "no...
  5. D

    Need to select from listbox and open form to that record

    Thanks Bob, that worked. I made a few little changes: Private Sub cmd_choose_Click() On Error GoTo Err_cmd_choose_Click Dim strSelection As String, varItem As Variant Dim strSQL As String Dim rst As DAO.Recordset Dim frm As Form 'do not save the attempted duplicate...
  6. D

    Need to select from listbox and open form to that record

    Yes, it is. The popup form is triggered by the before update event in the Last Name text box. So if I type "Smith", the form (frm_duplicates) pops up with a listbox of people named Smith and asks me if I meant one of those. If I click a name and click the cmd_choose button, it is supposed to...
  7. D

    Need to select from listbox and open form to that record

    Hm, we're getting closer as it now closes frm_duplicates and resets the focus on frm_checklist, but the frm_checklist doesn't actually go to the record, it stays where it was. My code (The line I added is in red.): Private Sub cmd_choose_Click() On Error GoTo Err_cmd_choose_Click Dim...
  8. D

    Need to select from listbox and open form to that record

    This line already does that: strSQL = "tbl_employees.PersonID = (" & strSelection & ")" I don't think it's a matter of being able to find the record - in fact I have a very similar form already that lets you search by last name - it's something to do with actually opening the form.
  9. D

    Need to select from listbox and open form to that record

    Hi, I have a form where people can enter new employees. If they enter in a last name that matches a current employee, I have a pop-up form asking them to check for duplicates. There is a listbox on this form that contains possible duplicates, for example Jane Smith Joe Smith Bob Smith What I...
  10. D

    Error with DoCmd.RUNSQL Update code

    Works great, thanks!
  11. D

    Error with DoCmd.RUNSQL Update code

    I am trying to update a date field (enddate) in a table (tbl_employees) with the value of a text box (TerminationDate) in a form. The format of the text box is set to short date. Private Sub TerminationDate_AfterUpdate() Dim termdate As Date termdate = Me.TerminationDate.Value If Not...
  12. D

    Searching a subform from a textbox on main form

    Yes, that works great! My ultimate goal was to be able to delete the selected person, so I've combined it with some code for deleting from a listbox. (I'm too new to link to the page where I found the code, apparently.) I'm still kind of amazed that subforms don't work how I think they should...
  13. D

    Searching a subform from a textbox on main form

    I have a main form, frm_search, based on a table, tbl_people. The main form has a subform, sfrm_people. All I want to do is have the user type all or part of the person's last name on the main form, and have a list of ALL people with the matching string in the subform. i.e. If there are two...
Back
Top Bottom