I have building a database that records information on participants in an activity our group puts on. To participate in the activity, you have to pay a certain amount of money. When you apply to get into the activity and are approved, you indicate whether or not you’ll make 1 or 2 payments. I’ve got the form set up that asks for the number of payments—call it PymntPlan. That's based on a query.
I’d like it if as soon as someone enters a “1”, this would append a record to a Payments table putting the ParticipantID in there and a “1” in the PaymentNo field. If a “2” is entered, I’d like it to append two records to the Payments table, both with the same participant ID but one with a “1” in the PaymentNo field, the other with a “2” in the field. There is an auto primary key called PaymentID in the Payments table so the records will be unique but I need them to be associated with the participant.
I don’t want to make the person entering the info push a button because
they might forget.
I also don’t want duplicates for the participant so if they inadvertently hit the enter key again in that field when they happen to be in the PymntPlan form I want it to check to make sure there is no record(s) for the participant.
I want to do this so that when we open up a Payments form it will show the participant's name and also display all the fields for the participant's payments. Thus we'd see Payment 1 and it asks for the date for that payment if it doesn't already have one, and the amount of the payment, and method of payment, etc. If the participant had indicated that there would be 2 payments then we'd see two of these. I know how to do subforms but nothing shows up for the participant if the record doesn't already exist for him in the Payments table.
I’m not familiar with VBA or SQL or macros. Although I’ve learned a lot reading in this forum and I’m coming along, I just don’t know how to do this. I figure it has something to do with an Append Query and probably an IIf statement but I’m not sure how to do this or where to put it so it happens automatically. And do I need a lookup table with a blank record?
Help will be greatly appreciated. Thank you.
I’d like it if as soon as someone enters a “1”, this would append a record to a Payments table putting the ParticipantID in there and a “1” in the PaymentNo field. If a “2” is entered, I’d like it to append two records to the Payments table, both with the same participant ID but one with a “1” in the PaymentNo field, the other with a “2” in the field. There is an auto primary key called PaymentID in the Payments table so the records will be unique but I need them to be associated with the participant.
I don’t want to make the person entering the info push a button because
they might forget.
I also don’t want duplicates for the participant so if they inadvertently hit the enter key again in that field when they happen to be in the PymntPlan form I want it to check to make sure there is no record(s) for the participant.
I want to do this so that when we open up a Payments form it will show the participant's name and also display all the fields for the participant's payments. Thus we'd see Payment 1 and it asks for the date for that payment if it doesn't already have one, and the amount of the payment, and method of payment, etc. If the participant had indicated that there would be 2 payments then we'd see two of these. I know how to do subforms but nothing shows up for the participant if the record doesn't already exist for him in the Payments table.
I’m not familiar with VBA or SQL or macros. Although I’ve learned a lot reading in this forum and I’m coming along, I just don’t know how to do this. I figure it has something to do with an Append Query and probably an IIf statement but I’m not sure how to do this or where to put it so it happens automatically. And do I need a lookup table with a blank record?
Help will be greatly appreciated. Thank you.