473,379 Members | 1,491 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,379 software developers and data experts.

Add record in bound form

Hi

In .NET I created a form with bound controls (Access Database). I used a dataset and followed examples to create a navigation using the Binding Context. So far everything goes well
My question, how do I add a new record to the database AFTER the user filled in the fields on the form. When the user presses a buttonNEW all controls (bound) need to be empty on the form so the user can fill in the fields. When the user presses the buttonSAVE the record needs to be saved. The problem is that my database has some fields that are required before I can add the row to the database. I can't find a solution anywhere.

Do you know how to do this. How to display a new row in a form with bound controls.

Thx in advance!
Mauric

Jul 21 '05 #1
1 1304
Maurice:
"Maurice" <an*******@discussions.microsoft.com> wrote in message
news:C9**********************************@microsof t.com...
Hi,

In .NET I created a form with bound controls (Access Database). I used a dataset and followed examples to create a navigation using the Binding
Context. So far everything goes well. My question, how do I add a new record to the database AFTER the user filled in the fields on the form. When the user presses a buttonNEW all
controls (bound) need to be empty on the form so the user can fill in the
fields. When the user presses the buttonSAVE the record needs to be saved.
The problem is that my database has some fields that are required before I
can add the row to the database. I can't find a solution anywhere.
Do you know how to do this. How to display a new row in a form with bound controls..
Thx in advance!!
Maurice


Since you're using a BindingContext, you can all the .AddNew Method to add
a new row and effectively clear what's there. Now, you may want to consider
adding Default values to your respective DataColumns once you have your
dataset filled. When you add a new record, those values will populate
themselves, so its a must that everythign is blank, this won't do it for
you. however, once you hit the Save button, you can check the values of the
row and if they aren't there and are required, you can programatically add
them.

If you could tell me a little more about the overall scenario, I could be of
more help. For instance, are you only doing simple binding or are you using
Grid/ListBox/Combobox? Do you have any datarelations defined? what
specifically is the problem you have now, that you can't add a new row or
that it won't save on update?
Jul 21 '05 #2

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

Similar topics

5
by: HJ | last post by:
Hi all, Consider an Access 2002 run-time application on Windows XP. The controls on a form are locked until the user clicks an Edit button. The form is based on a query and all controls are...
3
by: William Wisnieski | last post by:
Hello Everyone, Access 2000, I have a main unbound form with a bound datasheet subform . The subform is bound to a query that returns records based on criteria in the main form. The user...
6
by: Nothing | last post by:
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...
2
by: dixie | last post by:
I know I've asked this before, but the answer elludes me and the message has long since disappeared from my newsgroup messages. How do you save a record using vba from a button or as part of an...
5
by: Xiphias | last post by:
Hi, Can someone help me to create a drop box where I can also add new records? Here is the problem: I m working on a form with a drop box. When I select a '"name" in the drop box the form...
5
by: Steve Strik | last post by:
My Problem: I have created a database here at work that is exhibiting some very strange behaviour. Essentially the database is structured in a manner where one table is a master record table...
22
by: Br | last post by:
First issue: When using ADPs you no longer have the ability to issue a me.refresh to save the current record on a form (the me.refresh does a requery in an ADP). We usually do this before...
10
by: sara | last post by:
Hi - I have been struggling with solution ideas for this now for almost 2 weeks, and have not been able to figure this out. I have a user who creates a Purchase Order (tblPOData). In some...
19
by: emanning | last post by:
Using Access 2003 and using a form that's mostly bound. I need a way to tell if user-1 is on the record when user-2 tries to open the same record, w/o waiting for the user-1 to save the record...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.