473,837 Members | 1,487 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Bugs in Clearing Form

I have an edit record form with several text boxes, combo boxes, and
check boxes. All of them are bound except for one combo box
(cboPositionDat a), which I use to search for a specific record. I
have a Clear button which I have coded to use the Me.undo if the form
is dirty. I am testing for a situation in which the user would stop
trying to enter data in cboPositionData and clear the form. When I
enter a partial value in cboPositionData and then hit Clear, it pulls
up a record or jumps to the next field. I have to click Clear again
before it will clear the form.

If I enter a full field value in cboPositionData and then click Clear,
I receive error 3020 in the Form_BeforeUpda te event saying that
"Update or CancelUpdate without AddNew or Edit". After I click OK on
the error message, I then have to click Clear again. I have also
tried calling a function to clear the form but with the same results.
Would anyone have any suggestions on how to deal with these two
different issues such that one click on Clear will clear the form,
including the cboPositionData control?

Thanks,
Alex
Nov 12 '05 #1
3 2189
Response below.

"Alex Wisnoski" <Al***********@ ncmail.net> wrote in message
news:5c******** *************** ***@posting.goo gle.com...
I have an edit record form with several text boxes, combo boxes, and
check boxes. All of them are bound except for one combo box
(cboPositionDat a), which I use to search for a specific record. I
have a Clear button which I have coded to use the Me.undo if the form
is dirty. I am testing for a situation in which the user would stop
trying to enter data in cboPositionData and clear the form. When I
enter a partial value in cboPositionData and then hit Clear, it pulls
up a record or jumps to the next field. I have to click Clear again
before it will clear the form.

If I enter a full field value in cboPositionData and then click Clear,
I receive error 3020 in the Form_BeforeUpda te event saying that
"Update or CancelUpdate without AddNew or Edit". After I click OK on
the error message, I then have to click Clear again. I have also
tried calling a function to clear the form but with the same results.
Would anyone have any suggestions on how to deal with these two
different issues such that one click on Clear will clear the form,
including the cboPositionData control?


The code behind your "cboPositionDat a" combo box is executing before the Undo
method is invoked because the control is being updated when the focus is moved
to the command button. To avoid this, the combo box text entry would need to be
undone before leaving the same and, offhand, I can only think of using the
"Escape" key to do this. The other alternative might be to use a form where
*all* the controls were unbound and, using code, populate the form and update
the records to avoid undesired updates.

--
Bruce M. Thompson, Microsoft Access MVP
bt******@mvps.o rg (See the Access FAQ at http://www.mvps.org/access)
NO Email Please. Keep all communications

within the newsgroups so that all might benefit.<<
Nov 12 '05 #2
This isn't perfect, but have you thought about disabling the clear
button on the combo's got focus event & re-enabling it when the combo
loses focus? You can handle an incorrect entry before re-enbling the
button.

Neil
Nov 12 '05 #3
"Bruce M. Thompson" <bthmpson@big_N OSPAM_foot.com> wrote in message news:<10******* ******@corp.sup ernews.com>...
Response below.

"Alex Wisnoski" <Al***********@ ncmail.net> wrote in message
news:5c******** *************** ***@posting.goo gle.com...
I have an edit record form with several text boxes, combo boxes, and
check boxes. All of them are bound except for one combo box
(cboPositionDat a), which I use to search for a specific record. I
have a Clear button which I have coded to use the Me.undo if the form
is dirty. I am testing for a situation in which the user would stop
trying to enter data in cboPositionData and clear the form. When I
enter a partial value in cboPositionData and then hit Clear, it pulls
up a record or jumps to the next field. I have to click Clear again
before it will clear the form.

If I enter a full field value in cboPositionData and then click Clear,
I receive error 3020 in the Form_BeforeUpda te event saying that
"Update or CancelUpdate without AddNew or Edit". After I click OK on
the error message, I then have to click Clear again. I have also
tried calling a function to clear the form but with the same results.
Would anyone have any suggestions on how to deal with these two
different issues such that one click on Clear will clear the form,
including the cboPositionData control?


The code behind your "cboPositionDat a" combo box is executing before the Undo
method is invoked because the control is being updated when the focus is moved
to the command button. To avoid this, the combo box text entry would need to be
undone before leaving the same and, offhand, I can only think of using the
"Escape" key to do this. The other alternative might be to use a form where
*all* the controls were unbound and, using code, populate the form and update
the records to avoid undesired updates.


Thanks for your response and suggestions. I am going to give serious
thought to changing my form to unbound. I am beginning to get the
distinct impression that bound forms are fine until what I am trying
to accomplish gets a little involved. At that point I think the
unbound form becomes 'simpler' to reach my objective. Thanks again
for your help.

Alex
Nov 12 '05 #4

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

Similar topics

0
1154
by: Jeff Levinson [mcsd] | last post by:
Not as far as I know. The easiest way is just to create a loop to set all of the controls values to "". You'll probably have to use a typeof statement to come up with specific clearing methods for different controls, but I don't think there is an automatic way to reset the page. I could be wrong though... Jeff Levinson >-----Original Message-----
2
2891
by: Robin | last post by:
Ok, I have a form that on clicking of the Update button first updates the specific record in the db, then Inserts if the vMemo field is not empty. The problem that I'm having is that After updating if you hit the key (refresh) it inserts another record ... I have tried: 1. Clearing the vMemo field after the insert is done (vMemo = "") 2. Setting the value on the form for this field to "" Neither of these are working. It's not...
2
1872
by: Savvas | last post by:
Hi everybody, I have a lot of textboxes on my form and a "Clear" button. Is there a way with a for loop or something to clear the textboxes, instead of writing textboxName.clear? Thanks a lot
3
392
by: Alex Wisnoski | last post by:
I have an edit record form with several text boxes, combo boxes, and check boxes. All of them are bound except for one combo box (cboPositionData), which I use to search for a specific record. I have a Clear button which I have coded to use the Me.undo if the form is dirty. I am testing for a situation in which the user would stop trying to enter data in cboPositionData and clear the form. When I enter a partial value in...
3
15061
by: Brad | last post by:
I'm working with a DataGrid in C#, and the user needs to be able add and remove columns from the DataGrid on the fly, without opening and closing the form. The scenario is this. I have a setup table that allows users to rename columns, resize columns, and select whether or not they want them to be visible or not. While the user is working with a certain set of data, they will want to see certain columns, and in certain situations they...
2
1705
by: John Smith | last post by:
Hi folks, I have a form with ASP.NET web controls. At the end of the form there's the "Clear" button to clear the available values and start over. How do I do that? The following did not work because it unloaded the controls, and not just clearing the values: - this.Controls.Clear();
1
1286
by: Shahid Juma | last post by:
Hi, I have a form and when the user clicks save, it will add all the details to the database. However, when I add it to the database, how do I clear the form values? What happens is that it updates a label which I added informing that it was saved but the form is still filled in with values. Any ideas?
1
4274
by: scprosportsman | last post by:
Please help guys, i am trying to set up a database here at work and im fairly new to access in terms of writing functions and queries and stuff. I have 2 different places on my design that will require checking a check box to tell which category something will pertain to. Well after each record is entered i want the check to remain with that record and auto clear when going to the next record so i can input something else if i have a...
19
2211
by: Alan Silver | last post by:
Hello, Having discovered what I believe to be two CSS bugs in IE7, I have submitted bug reports to MS. AFAIK, these don't get acted on until they receive votes form others to say they are worth investigating. As (I naively assume) it's in everyone's interest to see IE7 support CSS properly, would anyone care to vote for these bugs, so that they might get fixed before IE7 comes out of beta?
1
1753
by: Vayse | last post by:
I have a databound form, frmClients. One of the field is a combo box, comDepartment, which lets a user select a department for the Client. But I can't figure out how to clear the box. That is, sometimes a Client is dropped by a Department. How would a user clear the combo box so that no Department is selected? With the combo box dropdown style: Dropdown: User must pick from the list, so there is no way of clearing the box Dropdown List:...
0
9839
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9682
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10871
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
10564
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...
0
10268
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9396
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5668
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4039
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3123
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.