[dba-VB] C# Help with binding components

Charlotte Foust cfoust at infostatsystems.com
Tue Mar 30 10:16:45 CDT 2010


So you're talking about using the combo as a navigational tool?  We create user controls for this purpose and load them into the header area of the form.  Our nav controls have next/prev buttons and a combo that allows the user to select a particular record.  The nav control has a handler in the form and the form sinks the results of a change in value and calls a routine to reload the data for the form using a where clause built on the nav control value.  Or possibly uses the data for the filter property of a dataview and sets the binding context of the form to that.  There are other possibilities that I leave you to discover. 

Charlotte Foust

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Sunday, March 28, 2010 5:36 AM
To: VBA
Subject: [dba-VB] C# Help with binding components

I want to load one record in a main form - client, product etc.  I want to use a combo which SELECTS 
the client and on the change event, do some undefined thing to cause that client form to load the 
record selected with the client id from the combo.

Seems simple enough.

Except I am having difficulty understanding which of the binding objects hold what parts of the 
equation.

I created a "bound form" which pulls the entire table but displays the current record in individual 
controls.

So for starters, now that I have that, how do I set a sql statement to load just one record?  What 
component does that and what property?

Next, I have a navigation widget that causes the form to move through the records.  If I only have a 
single record I do not need that so I want to get rid of it.  I assume it is safe to just delete it?

Except that object also has the add new / delete and save buttons.  Hmm...

And finally (for now), have found code to watch the controls for changes and set a dirty flag.  How 
do I save the record?  What object / property?

Once I see this done one time I will be good to go but I am not finding code on the web that does 
this.  Everything assumes loading the entire recordset then filtering down.

Any assistance greatly appreciated.
-- 
John W. Colby
www.ColbyConsulting.com
_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com





More information about the dba-VB mailing list