473,796 Members | 2,462 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Form Closes and Adds Record

I have a form that opens. On this form there is information along with a
button that opens a payment form.

The payment form opens and I enter a payment type, cash check or charge,
a payment number like the cc number or check number, and the amount of
the payment.

I have a button on this form that when clicked adds the payment to a
table via a sql statement in vba which works fine.

My problem is when I click my close button it adds a second payment
record using the same information that I just added. I can not figure
our how to get the form to close and NOT add the second record.

It is driving me nuts!! How do I get the form to close and NOT add
another payment line??? The only time I want a payment line added is
when I click the add button.

Any help would be greatly welcomed!!

Michael Charney
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #1
6 1864
DFS
Two possibilities I can think of:

1) the Close event of the payment form also adds the payment record
2) the form is bound to a table and when you enter the data it adds a
payment record automatically

"Nothing" <me@you.com> wrote in message
news:3f******** *************@n ews.frii.net...
I have a form that opens. On this form there is information along with a
button that opens a payment form.

The payment form opens and I enter a payment type, cash check or charge,
a payment number like the cc number or check number, and the amount of
the payment.

I have a button on this form that when clicked adds the payment to a
table via a sql statement in vba which works fine.

My problem is when I click my close button it adds a second payment
record using the same information that I just added. I can not figure
our how to get the form to close and NOT add the second record.

It is driving me nuts!! How do I get the form to close and NOT add
another payment line??? The only time I want a payment line added is
when I click the add button.

Any help would be greatly welcomed!!

Michael Charney
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #2
The form is bound to a table.

So how do I get it to NOT add a record when I close the form?

Michael Charney

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3
Are you adding a default or aytomatic payment date to a field, in which case
there will appear to be information for a new record.

Phil
"Nothing" <me@you.com> wrote in message
news:3f******** *************@n ews.frii.net...
The form is bound to a table.

So how do I get it to NOT add a record when I close the form?

Michael Charney

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #4
There are 5 fields in the form. Two of them have information assigned to
them when the form is opened. The otehr 3 are added by the user.

How to do I cancel the record add event when the form closes?

Michael Charney

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #5
DFS
Nothing,

If the form is bound to a table it will usually open to the first record in
the table, unless the form is set for Data Entry, in which case it opens to
a new record. That sounds like what's happening.

Either unbind the form from the table and use your 'Add Payment' button as
usual, or leave it bound and delete the 'Add Payment' button and recognize
when you enter the data you're entering a new payment record.

"Nothing" <me@you.com> wrote in message
news:3f******** *************@n ews.frii.net...
The form is bound to a table.

So how do I get it to NOT add a record when I close the form?

Michael Charney

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Nov 12 '05 #6
Thanks. I cam to the realization that I should not have bound the form
to the table. I unbound the form and it works exactly as I thought it
should.

Thanks for all the help.

Michael Charney

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
8912
by: Kyralessa | last post by:
In Access 2000, I have a base form with a ListBox of conference registrants. In the form's declarations section I include Dim f as Form To add a registrant I'm doing this: Set f = New Form_frmSingleRegistrant f.Caption = "New Registrant" f.cmdSave.Caption = "&Save New Registrant"
4
4042
by: William Wisnieski | last post by:
Hello Everyone, Access 2000 I have a form with multiple pages on it. There is one text field on the third page of the form that I need the user to complete before leaving the form or moving to the next record. So, in the BeforeUpdate event of the form itself I have the following code:
1
1823
by: Mike | last post by:
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
2
2086
by: Douglas Buchanan | last post by:
This is a mystery! Why does the boolean value of a record change without my input. What follows describes the situation and the behavior. Table1: Field1: Text Field2: Yes/No Form1 has two subforms. Toggle1 selects Subform2
6
6588
by: Miguelito Bain | last post by:
hi everybody- i have a form with 2 fields on it that i want the user to fill out before he or she can save the record, close the record, or move to the next record, etc... here's the code i tried. if i just enter minutes and click close, the form closes. it seems to bypass my nested if statement.
1
2356
by: Daniel | last post by:
Hi, i need som help!!! I have a form wich a user type some new data in! And when he/she hits the 'Add' button... i want the data on the form to fly straight into an existing table!! Please send some example....
8
2465
AccessIdiot
by: AccessIdiot | last post by:
Please forgive as I am an Access and VB newbie. For what it's worth, here is my complete setup. Maybe it will help or maybe it will just confuse but I'll outline it anyway. I have a main form that has 3 buttons. Each button opens the same form (frm_Survey) but passes a different string to the form. When a button is clicked the main form is closed to prevent the user from pressing another button. The form that is opened is frm_Survey. The...
22
2496
AccessIdiot
by: AccessIdiot | last post by:
Hello all, I have a form (frm_Entrainment) with a button that opens a 2nd form (frm_Specimen_Entrainment). The 2nd form shares an ID field with the first form (Entrainment_ID - its like opening the Orders form for a particular Customer). I have a button on the 2nd form that says "return to the first form" which really is just sitting beneath the 2nd form. When the button is clicked it simply closes the 2nd form so you can see the 1st form...
9
2814
by: AMBLY | last post by:
Hello ! Hope someone might be able to help me with this one. I run Access2000 on XP. I have a form : frmONE- which contains a txt field: ctrCTN from my table/database. The values in ctrCTN are unique. Next to this field is a cmdFIND button frmONE is open and the active window. I want to search for values in ctrCTN, and go to the record which contains that value. I do not want to use a cmdButton with in-built Access Find procedure to...
0
10457
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10231
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10176
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7550
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6792
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5576
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4119
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2927
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.