Re: Questions on combo box and MSFlexGrid

Tech-Archive recommends: Speed Up your PC by fixing your registry



Thank you for your reply.

I will take a look at the DBGRID and DBCombo and give them a try.

Thank you again!

"nrford" <nrfordmsvb@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> ¼¶¼g©ó¶l¥ó·s»D:eyl8ix0TGHA.5900@xxxxxxxxxxxxxxxxxxxxxxx
"Reds@Office" <abc@xxxxxxx> wrote in message
news:OZSBn8xTGHA.736@xxxxxxxxxxxxxxxxxxxxxxx
I am writing a VB project that connected to an Access Database.
An interface is created for users for querying and comboboxes are
provided
for them to choose different field(Actually these are the Field Name in
the
Access table) as they needed.

My first question:
When the users choose a fieldname in combobox, anther combobox will be
appeared for them to input data. Is there any method that can sort all
the
values in the field(from the Access DB) and place them in ascending order
in
the combobox?

My second question:
When the query is performed(By using SQL statement), I would like the
result
to be displayed in a MSFlexgrid table. How can I place the fieldnames and
the records in the table as it is looked like in Access?

In both cases, you have two alternatives:

1. Use a databound control -- DBCombo and DBGrid, respectively.
2. Use a standard control and manually fill it.

People here seem to hate databound controls in general.
I have used DBGrid extensively and never had any kind
of problem with it. I have tried DBCombo and always
had problems, so I use the 2nd alternative in that case.
Just use a standard Combo box with the Sorted property
set to True, and manually read the fields into it.

I think that most people's objection to DBGrid is for data entry.
I usually use DBGrids for easy viewing of the database and use
other controls for data entry. See a screen shot at
http://www.cardsharkgames.com/CSBBEditor.jpg

However, the last app I wrote uses DBGrid for data entry
because I didn't need as much control over the data entry.
It works fine. I control input using the DBGrid Change and
KeyDown and some other events. See a screen shot at
http://www.cardsharkgames.com/bbhep.jpg




.



Relevant Pages

  • Re: Questions on combo box and MSFlexGrid
    ... I think that most people's objection to DBGrid is for data entry. ... See a screen shot at ... because I didn't need as much control over the data entry. ...
    (microsoft.public.vb.database)
  • Re: Questions on combo box and MSFlexGrid
    ... When the users choose a fieldname in combobox, ... Use a databound control -- DBCombo and DBGrid, ... I think that most people's objection to DBGrid is for data entry. ...
    (microsoft.public.vb.database)
  • dbgird combobox width problem
    ... I've a combobox in dbgrid, when i increase the column width on runtime then ... but if i decrease the column width combobox is not resizing ... if (EditMode in [dsEdit, dsInsert]) then ...
    (borland.public.delphi.language.objectpascal)
  • VS 2005 C++ project - problem with activex controls
    ... it will alow me to add the activex flexgrid ... or DBgrid control to the dialog and I can set properties. ... variable and it generates a wrapper class. ...
    (microsoft.public.vc.mfc)
  • Re: How to control a clic in the scroll bar
    ... > How can I control a clic in the vertical scroll bar of a DBGrid? ... Use the onDataChange event of the datasource to update the title label. ...
    (comp.lang.pascal.delphi.misc)