PC Review


Reply
Thread Tools Rate Thread

Databinding and editing data on another form

 
 
Matt A.
Guest
Posts: n/a
 
      2nd Nov 2005
I'm having some difficulty wrapping my hands around a problem I am
having....

Here is the situation, I'll use the classic "Customers / Invoices"
example to explain it. I'm displaying a list of customers on a form
(call it Form1) using a grid control. No problem.... It displays a
subset the data as I need it, etc. I'm primarily using this for just
display.

I have another form (call it Form2) that I want to use for editing the
"Customer" and "Invoices" (and other related data) using bound controls
Right now, it is setup so that when the user double clicks the entry
in Form1, it passes the key onto Form2. Form2 has the necessary data
adapters & dataset setup so that it uses a parameter to query the DB
using the key passed from Form1. This works just fine. I can edit the
entry, save it, etc. No problem.

Where I am running into a problem is trying to add a new "Customer."
Ideally, I want to have a "Add new" button on Form1 which of course
launches a blank Form2. If the user cancels, the no record would get
added. Right now, I cannot seem to get the databound controls on Form2
to bind to a new record.

Right now, when adding a new entry, I have it setup so when the Form2
loads, it runs the parametrized query so that it returns no records. I
then manually add a new datarow to the dataset's table. I've tried
using CurrencyManager or BindingManagerBase to set the current record
to the new entry, with no luck.

If I add bogus data when I add the new record, then perform in update,
it gets written to the database, OK. I just can't seem to get it to
bind properly to the controls.

(Using MS Access database - BTW)

Any thoughts / suggestions?

Matt A.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I create a form with column headers based on the data for data editing? Stapes Microsoft Access 1 15th Jun 2007 05:30 PM
Editing Data in a form =?Utf-8?B?b2tz?= Microsoft Access Forms 1 23rd Mar 2007 01:56 AM
Editing Data on a form =?Utf-8?B?TGluIExpZ2h0?= Microsoft Access Form Coding 2 9th Jun 2006 01:41 PM
Adding new records when databinding and using data relation win forms / data form wizard Developer Microsoft ADO .NET 0 16th Aug 2004 07:28 PM
Data editing in a form Bruce Microsoft Access Forms 1 15th Oct 2003 06:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:05 PM.