473,395 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Adding new record clearing the fields

15
Good day,

I want to save record then clear the field for my next entry except for one unbound field not to be clear.?

i tried the DoCmd.GoToRecord , , acNewRec but it clears all data in my field together with my one unbound filed.

Need some help?.
Oct 29 '14 #1
5 1377
Seth Schrock
2,965 Expert 2GB
It doesn't sound like your control is really unbound then.

One option would be to store the value in the unbound control in a variable, use the DoCmd.GoToRecord command and then reset the value of the control back to the value in the variable.
Oct 29 '14 #2
natyboi
15
ok. to simplify . i would like to clear specific field after i add data
Oct 29 '14 #3
twinnyfo
3,653 Expert Mod 2GB
natyboi,

What is the purpose of keeping the one specific field's data? Are all these records related via that value? If so, then it would make more sense for your form to be set up as a Parent/Child, with the subform bound to a separate table, with a foreign key to your non-changing value of the main table. Then, every time to go to a new record on the subform, everything is cleared except for the main-form's value.

Not sure if I explained that very well. Those of us who have been doing this for a long time understand the principle, but it is all based on having tables that are properly Normalized (see this thread).

@Seth, does this sound right to you?
Oct 29 '14 #4
Seth Schrock
2,965 Expert 2GB
@natyboi If all (or some for that matter) of the controls that you want cleared are bound, then your only option to clear the fields without editing a record is to go to a new record. From my experience and knowledge of how things are supposed to work, an unbound control shouldn't (without other code changing the value) make the unbound control get cleared when you move to the new record. My suggestion would be to check your form's On_Current event to see if there is code or a macro that is editing the value of this control manually.

@twinnyfo You have the subform idea correct, but I'm guessing that this isn't the case here. However, I can't come up with what the case actually is either, so you might be right :)
Oct 29 '14 #5
jimatqsi
1,271 Expert 1GB
natyboi,
Keep in mind the before insert and after insert events on the form. You could easily put some code into the After_Insert event to clear the field.

Jim
Oct 29 '14 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
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,...
2
by: Oliver Gabriel | last post by:
hello, i have a form with a table on its back. The primary key is an autonumber field called "ID". I have a textfield displaying the value of this field (just for my info, data is sure entered...
20
by: Bryan | last post by:
hello all... im trying to add a record to an sql db on ms sql server 2000, using vb.net. seems to be working.. except for one thing, one of the columns in the database is a bit datatype, and...
9
by: Greg | last post by:
Binding Manager & dataset - won't add record I've got an untyped dataset with controls bound through code. The user can select a question number from a bound combobox, and the question number and...
1
by: accessbee | last post by:
(Sorry this is so long, was trying to fully explain the situation) There are two tables that handle information on our clients. Every client has a unique ClientID, and the ClientID is the Primary Key...
5
by: rdemyan via AccessMonster.com | last post by:
I have a table with about 80 fields. I'm using an import process to populate the table. It works fine, except for the following: Users generally don't specify values for a lot of numerical...
5
by: sara | last post by:
Hi - I have 2 new questions in a new database I'm trying to develop. The first has 6 fields on a table and allows the user to enter them on a form. The form is bound to the table. All 6...
1
by: vivekvt | last post by:
-------------------------------------------------------------------------------- here is the code to the asp page that adds data to the access database! <html> <body> <% Dim recordsaffected
0
omerbutt
by: omerbutt | last post by:
ih i have made an ASP page on which i am getting the values from a FORM and i am inserting those values into the AccessDatabase but the problem is that it is inserting each entry twice can any 1 help...
1
by: Steve | last post by:
This may be a dumb questions please forgive I have a form that shows a list box that links to a table with 7 employee names The form does not show employee key. When adding record to master...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
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...
0
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...
0
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,...

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.