Recent content by LBinGA

  1. L

    Copy Subform rs to New Record

    Ok. Duh. :banghead: I better go get some more coffee...... Thank you!!!! LB
  2. L

    Copy Subform rs to New Record

    So, another question related to this, if I may..... Is there a way, through this code, to retain the default values in the new record when I "Copy Into New"? The code is creating a new record but the default values do not carry over causing issues with some calculations (anything times 0 is...
  3. L

    Copy Subform rs to New Record

    Hot D@MN! That was it! I moved the CommitTrans up over the With containing the .FindFirst and it works! I'll call this solved and here is the final code for those interested. Private Sub BtnCopyIns_Click() On Error Resume Next Err.Clear If Me.Dirty Then If MsgBox("Save...
  4. L

    Copy Subform rs to New Record

    Perfect! I had it that way for two of the conditions but not the first one. I've now changed it. In any case, with that change, it generates the copy but then gives the MsgBox "Record not found!" and then reverts once again to the last record in the set. "It's always something!!!" ~Roseann...
  5. L

    Copy Subform rs to New Record

    Ok, thanks! Attached a copy of db with the new code with what you gave me as follows: lngPK = iNewID Me.Requery 'return form to original record With Me.RecordsetClone .FindFirst "InsuredID = " & lngPK If .NoMatch Then 'just in case another user deleted it in the interim MsgBox...
  6. L

    Copy Subform rs to New Record

    Yes. I tried iNewID, me.iNewID and me.NewID. Neither worked. The error is: Compile Error: Method or data member not found. It stops here: lngPK = Me.iNewID Thanks!! LBinGA
  7. L

    Copy Subform rs to New Record

    I added this to after the line: CurrentDb.ExecutestrSql Dim lngPK As Integer 'change data type if yours is different 'set variable to current record ID lngPK = Me.InsuredID Me.Requery 'return form to original record With Me.RecordsetClone .FindFirst "InsuredID = " & lngPK If .NoMatch...
  8. L

    Copy Subform rs to New Record

    Hallelujah, pbaldy! That worked! Thank you SO much! It is snapping over to the last record automatically. How can I set the focus to the newly created record? Remove the "requery"? Lastly, I have 3 conditions, based on the Type of Insurance chosen. I will try to morph what you did into...
  9. L

    Copy Subform rs to New Record

    Anyone? The db is attached. I've changed the code to something I found here from back in 2012 as follows but it is still not working. It's found on the Copy to Ren button on the Quote Sheet. Private Sub BtnCopyIns_Click() On Error Resume Next Err.Clear If Me.Dirty Then If...
  10. L

    Copy Subform rs to New Record

    I've reviewed Mr. Browne's code and tried to put it into what makes sense for my db. It copies the main form but the Subform does not copy. I'm certain I don't have my ID path accurate but I don't know what to change. Here's what I have thus far, which replaces the code I had prior (original...
  11. L

    Copy Subform rs to New Record

    Yes! I read it a little closer and see where I can just copy over the fields I'd like. I would like to send over the proper subform rs conditionally, based on the [Type of Insurance] field entry. I have 3 subforms but only one will be completed based on what is in the [Type of Insurance]...
  12. L

    Copy Subform rs to New Record

    Thanks, I did see that but was unsure of a couple of things: 1. I may be wrong but it appears to duplicate the entire record of the main form, which I don't want to do. I want some values of the main form and all values of the subform. 2. In either case, I don't know where to place this in...
  13. L

    Copy Subform rs to New Record

    Hello! I am trying to copy a subform record set from one record to the next record. The data in the main table is copied over using this method; Dim v1 As Variant Dim v2 As Variant Dim v3 As Variant Dim v4 As Variant v1 = Me![Today's Date].Value v2 = Me!Insured.Value v3 = Me!City.Value v4 =...
  14. L

    Passing Date Range Parameter to Multiple Subreports

    [SOLVED] Re: Passing Date Range Parameter to Multiple Subreports Well, messing around with it for a little longer made me realize that I was asking for the criteria to meet two dates and not asking for BETWEEN two dates. :cool: The SQL should have read as follows: PARAMETERS...
  15. L

    Passing Date Range Parameter to Multiple Subreports

    The SQL view of the crosstab queries running each subreport is as follows with the exception of the SELECT, is identical: PARAMETERS [Forms]![FrmDate]![Start Date] DateTime, [Forms]![FrmDate]![End Date] DateTime, [Forms]![FrmDate]![Enter Type of Audit] Text ( 255 ); SELECT...
Back
Top Bottom