By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,637 Members | 1,945 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,637 IT Pros & Developers. It's quick & easy.

Form Closing and Adding Record

P: n/a
I have a form that certain information on it. On this form there is a
button that opens a payment form.

When the payment form opens I enter a payment type, check cash charge,
payment number, check number or cc number, and then payment amount.

Next I click a button to process the payment which uses a sql
statement to insert the record into a payment table.

This all works fine. My problem is that when I click the custom close
button on the form, before the form closes it adds another payment
record.

How do I stop the second record from being added?? It is driving me
crazy.

Thank you very much in advance!!

Michael Charney
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Mike <me@you.com> wrote in message news:<u8********************************@4ax.com>. ..
I have a form that certain information on it. On this form there is a
button that opens a payment form.

When the payment form opens I enter a payment type, check cash charge,
payment number, check number or cc number, and then payment amount.

Next I click a button to process the payment which uses a sql
statement to insert the record into a payment table.

This all works fine. My problem is that when I click the custom close
button on the form, before the form closes it adds another payment
record.

How do I stop the second record from being added?? It is driving me
crazy.

Thank you very much in advance!!

Michael Charney


sounds like your Payment form is bound to a table, and for some reason
you're trying to write the record to the table with code behind a
button. So you're clicking the button, it adds the record, and then
you're closing the form, and it's saving the data again. Do one of
the following: (1) remove the code that inserts the new record; (2)
remove the recordsource from the form, so it can't write anywhere...
Personally, I'd chose #1. If you write the record to the table in
code, then you have to do all the checking for null values and all
that yourself. PITA if you have a lot of fields with complex
validations...
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.