Auto create record in subform NZ is not working

Ask a Question related to Microsoft Access, Design and Development.

  1. #1

    Default Auto create record in subform NZ is not working

    I have a form with participants to an event and their billing information.
    On it is a subform for multiple payments to this event. To get a balance due
    report I need to have some figure as a payment (even if is zero). How do I
    automatically create a record in this subform when ever a participant is
    created or is there a better way to do this.

    Peter Walker suggested I try the Nz function which sounded good.

    I tried the following code on a field on the main form and got an "Object
    doesn't support this property or method" error.

    Private Sub txbLastNam_AfterUpdate()
    Me![sfrmConferencePayment].[txbPaymentAmt] =
    Nz(Me![sfrmConferencePayment].[txbPaymentAmt], "0")
    End Sub

    I assume this is because there is no record created yet, but maybe I'm
    wrong. I'm looking for ideas.

    Thanks,
    Ken


    Ken Ivins Guest

  2. Similar Questions and Discussions

    1. Stop adding record in subform after record count = 1
      Can someone help in in what to put after the THEN statment to allow one entry if the Record count is =>1 in the Before insert or should I set the...
    2. create a find option to go to a record in a subform
      i have a main form which contains a subform,i want it so the user tpes in the data and clicks find, it then automatically should take the user to...
    3. Auto create record in subform
      In the calculation that gets the balances try using the Nz function. Nz(variant) You don't mention how you get the balances. (a VBA function is...
    4. Go to record in a subform
      This example assumes the subform contains a field named "OrderID", and uses the RecordsetClone of the subform to get the value from the last record....
    5. create record (in subform) automatically
      Hi all I'm beginning to think in the wrong way, so I need help. In an Access 2000 database I have two (very) related tables, Invoices and Amount...
  3. #2

    Default Re: Auto create record in subform NZ is not working


    "Ken Ivins" <ken-27@spa.net> wrote in message
    news:OOnt6WyRDHA.1720@TK2MSFTNGP12.phx.gbl...
    > I have a form with participants to an event and their billing information.
    > On it is a subform for multiple payments to this event. To get a balance
    due
    > report I need to have some figure as a payment (even if is zero). How do I
    > automatically create a record in this subform when ever a participant is
    > created or is there a better way to do this.
    >
    > Peter Walker suggested I try the Nz function which sounded good.
    At some point in the process or before you save the master record
    I assume you have an autonumber for the record key.
    docomd.runsql "INSERT INTO Billing (ParticipantID,SomeAmountField) VALUES ("
    & Me!ParticipantID & ",0);"


    Mike Painter Guest

  4. #3

    Default Re: Auto create record in subform NZ is not working

    Mike,

    With some other coding to get it to save first, this worked.

    Thanks,
    Ken



    "Mike Painter" <mpainteratattdotnet> wrote in message
    news:3a80b97e68b0795c907faec4abc3eff7@free.teranew s.com...
    >
    > "Ken Ivins" <ken-27@spa.net> wrote in message
    > news:OOnt6WyRDHA.1720@TK2MSFTNGP12.phx.gbl...
    > > I have a form with participants to an event and their billing
    information.
    > > On it is a subform for multiple payments to this event. To get a balance
    > due
    > > report I need to have some figure as a payment (even if is zero). How do
    I
    > > automatically create a record in this subform when ever a participant is
    > > created or is there a better way to do this.
    > >
    > > Peter Walker suggested I try the Nz function which sounded good.
    >
    > At some point in the process or before you save the master record
    > I assume you have an autonumber for the record key.
    > docomd.runsql "INSERT INTO Billing (ParticipantID,SomeAmountField) VALUES
    ("
    > & Me!ParticipantID & ",0);"
    >
    >

    Ken Ivins Guest

  5. #4

    Default Re: Auto create record in subform NZ is not working

    Not sure what that means. The statement does insert a record and all you
    would have to do is refresh the view.
    "Ken Ivins" <ken-27@spa.net> wrote in message
    news:u2xUas%23RDHA.2676@TK2MSFTNGP10.phx.gbl...
    > Mike,
    >
    > With some other coding to get it to save first, this worked.
    >
    > Thanks,
    > Ken
    >
    >
    >
    > "Mike Painter" <mpainteratattdotnet> wrote in message
    > news:3a80b97e68b0795c907faec4abc3eff7@free.teranew s.com...
    > >
    > > "Ken Ivins" <ken-27@spa.net> wrote in message
    > > news:OOnt6WyRDHA.1720@TK2MSFTNGP12.phx.gbl...
    > > > I have a form with participants to an event and their billing
    > information.
    > > > On it is a subform for multiple payments to this event. To get a
    balance
    > > due
    > > > report I need to have some figure as a payment (even if is zero). How
    do
    > I
    > > > automatically create a record in this subform when ever a participant
    is
    > > > created or is there a better way to do this.
    > > >
    > > > Peter Walker suggested I try the Nz function which sounded good.
    > >
    > > At some point in the process or before you save the master record
    > > I assume you have an autonumber for the record key.
    > > docomd.runsql "INSERT INTO Billing (ParticipantID,SomeAmountField)
    VALUES
    > ("
    > > & Me!ParticipantID & ",0);"
    > >
    > >
    >
    >

    Mike Painter Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139