Page 16 of 16 FirstFirst ... 678910111213141516
Results 226 to 238 of 238
  1. #226
    Etoimos is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Mar 2020
    Posts
    249

    Quote Originally Posted by pbaldy View Post
    You could, but that would mean you'd be opening the form with all records, which can bog down if/when you get a lot of records. I'd probably have a form with the 2 combos and a button. The button would use this method to open the form filtered to the desired record:

    http://www.baldyweb.com/wherecondition.htm

    You can do what you describe. If the form is based on the table, add a combo with the wizard, choosing the third option, "Find a record...". You'd have to tweak it to use both combos.
    Okay, so a combo selection form to open the form where they enter the data. I should be able to do that.... I think!

  2. #227
    Etoimos is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Mar 2020
    Posts
    249
    Okay, I created frmICRSelection and gave it comboboxes to select the Event and Scenario and then added the below code to a button:

    Code:
    DoCmd.OpenForm "frmICRTimeEntry", , , "Event_Name = '" & Me.EventCombo & "' AND Test_Case_Number = " & Me.ScenarioCombo & "", acFormReadOnly
    That button opens frmICRTimeEntry (and appears to be filtered to the correct record in Scenarios_tlb), but I can't enter the times into the text boxes on frmICRTimeEntry. I can click in the text box, but can not type anything. I can also click on the date picker, but it does not enter any date/time either. Any thoughts on what I'm missing?

  3. #228
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Perhaps this?

    DoCmd.OpenForm "frmICRTimeEntry", , , "Event_Name = '" & Me.EventCombo & "' AND Test_Case_Number = " & Me.ScenarioCombo & "", acFormReadOnly
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #229
    Etoimos is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Mar 2020
    Posts
    249
    Quote Originally Posted by pbaldy View Post
    Perhaps this?

    DoCmd.OpenForm "frmICRTimeEntry", , , "Event_Name = '" & Me.EventCombo & "' AND Test_Case_Number = " & Me.ScenarioCombo & "", acFormReadOnly
    No, that could not be it. LOL I should probably not try coding when I'm at work putting out multiple fires

    I did just change that to acNormal and I can enter the dates now. However, apparently my comboboxes are not working to select the record in the Scenarios_tlb as it is creating a new entry into that table instead of updating the current records.

  5. #230
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Is the form still in data entry mode? Can you attach the revised db? Opened that way, it should edit the record, not add a new one.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #231
    Etoimos is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Mar 2020
    Posts
    249
    I tried it with Data Entry set to Yes and No. Neither worked. I'll have to wait until I get home tonight before I can upload what I currently have.

  7. #232
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Okay. Data entry would need to be No for this form, since you want to edit existing records. I often use the same form for both, controlling the mode with the appropriate argument of OpenForm.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #233
    Etoimos is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Mar 2020
    Posts
    249
    Here is the stripped down db with that form set to no data entry. It still adds a new entry instead of updating the old.
    Attached Files Attached Files

  9. #234
    Etoimos is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Mar 2020
    Posts
    249
    Quote Originally Posted by pbaldy View Post
    I often use the same form for both, controlling the mode with the appropriate argument of OpenForm.
    That might be an option using the original scenario form. I'm going to mess with that and see how it works. Although, I'll still need a way for that form to filter to the correct record in the table.

  10. #235
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I guess I'm going to need instructions on how to recreate the problem. I chose "CDI..." and 11 and entered dates. That record was updated with the dates. I chose them again and the dates I entered were there. I changed one and the change was saved.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #236
    Etoimos is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Mar 2020
    Posts
    249
    Hi Paul,

    My workload is just now letting me get back to this issue. Here is a step by step of what I am doing and the results I get....

    1. Click on red ICR Selection button on the Test Events Switchboard.

    2. In the newly opened frmEnterICRTimes form, I select CDI 2020-0036 from the Event combo and 11 from the Test Case combo. Finally I click on the Open Form button at the bottom.

    3. I enter dates and times into the Sim Time and Sim Time Data fields on the newly opened frmICRTimeEntry form. I then click on the Enter Times button and that form closes. A note about this form, at the bottom in the Navigation Buttons section, it shows a yellow highlighted "Filtered" button. With this button on, it does not show any dates/times in the two fields. If I change it to Unfiltered, it does show the dates/times if there are any for that record. I'm not sure if this is important or not, but I thought I should at least mention it.

    4. I now open the Scenarios_tlb table and see a new record entry with no Scenario_Name, zeros in the Test_Case_Number, Duration, and Threat fields. The Sim_Time and Sim_Time_Data fields do have the dates/times that I just entered.

    5. I look at the original CDI 2020-0036 11 record, the one with the Name, Test Case Number, Duration and Threats data in it and the Sim Tim and Sim Time Data fields are empty.

    If I repeat steps 1-3 above, it does update that new nameless recorded that it created the first time.

    Is this the behavior that you are seeing?

  12. #237
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    If you add other fields to the form, you'll see that it isn't actually opening to the desired record, it's opening to a new record. I changed a few things so I'm not sure which worked, but I deleted the Filter By and Order By settings on frmEnterICRTimes, changed the Order By On Load to No, and changed the code to open it to:

    DoCmd.OpenForm "frmICRTimeEntry", , , "Event_Name = '" & Me.EventCombo & "' AND Test_Case_Number = " & Me.ScenarioCombo

    Oh, and I deleted the lookup field on the event name, as the table didn't exist. I think the OpenForm change may have been the key but I'm too lazy to test each.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  13. #238
    Etoimos is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Mar 2020
    Posts
    249
    Thanks Paul, I'll play around with that stuff when I get time.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 10-13-2014, 09:20 AM
  2. Replies: 6
    Last Post: 02-19-2014, 11:11 AM
  3. Replies: 3
    Last Post: 07-03-2013, 10:38 AM
  4. Replies: 1
    Last Post: 10-30-2012, 10:29 AM
  5. Replies: 1
    Last Post: 07-11-2012, 08:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums