Navigating through records

  • Thread starter Thread starter Martin Williams
  • Start date Start date
M

Martin Williams

This is my first post to this group. I am currently working on a project
for my Intermediate vb.net class. My project is a movie rental program,
which involves displaying customer records with transaction details. The
way it is set up now is that I have a group of bound text boxes to display
the customer information, and a datagrid to display the transaction details.

Also, I have a label to display the totals for each customer's transaction.
The problem that I am having is I don't know which event to use to "capture"
the current customer as I cycle through the records, so that I can
effectively target the childrows of the current customer.

If you need to see code, please let me know in the reply. Thanks for all
replies.

Regards,
Martin Williams
 
Hi Martin,

There is always a kind of default event generated when you double click on
your form on a control (textbox or whatever).

Mostly you can use that to capture the events.

In most cases is that the click event or the index changed event.

But I think that using a button or a menuItem will satisfy the user better,
because by using that he does an impliciet action and understood better what
happens.

If this is not the answer, or if I did misunderstood you, please reply?

Cor
 
Thank you for your reply.

Currently, I use toolbar buttons (first, previous, next, and last) to cycle
through the customer records. What I was looking for is some way to examine
the change in the bound value of one of the text boxes, whether it's the
customer ID or the last name, so I can target that in the code for getting
the child records - in order to continually update my subtotal and totals
textboxes.

Regards,
Martin Williams
 
Hi Martin,

When you use the changed-value event of the texboxes you user become mad,
becose it fires with every keypush.

But maybe you mean something like this (roughly copied and changed from a
program, so watch errors).
\\\
dim cmaMyCurrency As CurrencyManager
Me.combobox1.BegindUpdate()
Me.combobox1.DisplayMember = "ident"
Me.textbox1.DataBindings.Clear()
cmaMyCurrency = CType(Me.BindingContext(ds.Tables(0)), CurrencyManager)
Me.combobox1.DataSource = ds.Tables(0)
Me.textbox1.DataBindings.Add(New Binding("Text", ds.Tables(0), "lastname"))
Me.combobox1.EndUpdate()
///
The name in the textbox is the name in the current position from the
dataset, which is the same as the index from the combobox.

I hope this helps something?

Cor
 
Back
Top