Recent content by kforeman

  1. K

    Syntax for repetitive code

    Removing the quotes around "strName" fixed it and it works perfectly now. Thanks to everyone for all the help.
  2. K

    Syntax for repetitive code

    Thanks much, Peter, that did fix the syntax problems. However, strName is being considered text, not an actual string. So here's the code I've got thus far: Private Sub Gas3_change() OpenProblem "Gas3" End Sub Public Sub OpenProblem(strName As String) Dim stDocName As String Dim...
  3. K

    Syntax for repetitive code

    Thanks. I'm still getting an error, though. This line gives me a compile error "Expected: list seperator or )" when viewing it: If DCount("question", "problems", "[report id] = [forms]![report]![report id]" & " AND " & "[question] = [forms]![report]!("StrName" & "l").caption") = 0 Then I have...
  4. K

    Syntax for repetitive code

    Oh, and I have been able to get it working fine by copying/pasting the main sub and just doing a find replace on it, but the sub is quite long and there would be about 100 of them....I'm trying to keep the code clean and figured this is something I need to learn how to do anyways.
  5. K

    Syntax for repetitive code

    I have a whole bunch of buttons on a form which open a second form, create, a new record, etc, and fill it out with information from the original form. For instance, clicking button a1b would create a new record in a different table with the data from dropdown a1d and the caption of the label...
  6. K

    Records incorrect when new records added in other form

    Sorry to keep posting, but I added a Private Sub Form_activate() Requery End Sub and it's updating the records and letting me select the correct one now. Thanks for all your help. I know this probably isn't the most elegant way of accomplishing what I need to, but it works. (edit: moved...
  7. K

    Records incorrect when new records added in other form

    Ok, so I stupidly had turned off the record navigation buttons before I had finished the form, so I didn't notice what my problem actually is: when I use the combo boxes to select one of the records added after the first form was opened, it always selects the first record. Here's the code for...
  8. K

    Records incorrect when new records added in other form

    Yes, I just have the two combo boxes requeried upon hitting the close button. I unfortunately don't have access to the db right now, but I'll take a look in the morning.
  9. K

    Records incorrect when new records added in other form

    Both forms have "DoCmd.RunCommand acCmdSaveRecord" set to the deactivate event procedure (per msdn knowledgebase, so I don't know if that's the best place to put it). That got rid of the write errors, but the combo boxes were not accurate til I added the requery. I will try your suggestion...
  10. K

    Records incorrect when new records added in other form

    Thanks for the suggestions. At first I was getting write errors upon closing the second form, so I put in a save record on deactivate on both of them. And I have a requery on the close button of the second form. Those both seemed to have worked because it eliminated the write error and the combo...
  11. K

    Records incorrect when new records added in other form

    I have form setup with two cascading combo boxes (facility and date) to select a record (other navigation, including mousewheel, is disabled). There is a button to open another form which allows addition/deletion of records by facility and date. When this form is closed, the combo boxes update...
Back
Top Bottom