Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A form Instead of using Browse.....(Big Task)
Message
De
20/04/1998 12:29:15
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
A form Instead of using Browse.....(Big Task)
Divers
Thread ID:
00093432
Message ID:
00093432
Vues:
49
Due to Ime problem, My boss request me to make a form totally instead
of a browse with additional feature.

So, there are many tasks requesting. Some of them I can solve it, but
some fail. Let me list them out!

There are 1 grid, 1 Combox to Select Table, 1 combox for field,
1 combox for sign(+,-,LIke), 1 textbox for condition, some buttons
including search.

1) Remove Ime problem with Grid. Done!
2) Freeze Column at left most, Copy code from here, Thanks.
But How to freeze two columns if both are pk.
3) Reassign the Column Width if changing Recordsource
Finally, I find a easy solution on it! It will use default width!
Thisform.Grdlock1.ColumnCount = 0
Thisform.Grdlock1.ColumnCount = -1
ThisForm.Grdlock1.RecordSource = NewAlias
ThisForm.Grdlock1.Init  && Recall Clean IME Init procedure


4) Actually, Ordering and Search are most difficult.
How to check the selected Field has been set the Tag() ?!
If so, set the order when interactivechange of field
5) use don't want to add '' for text and {} for date on search
How to check the type of field to set the Locate statement.
because type() got error.
With Thisform
....
  do case
    case type(eval(.cbotable.value +[.]+.cbofield.value)) $ [NY]
      * Above got error
      * Normal for number
      Locate_expression = .cbofield.value + ;
         .cboSign.vale + .txtcondition.value

    case type(eval(.cbotable.value + [.]+.cbofield.value)) $ [DT]
      * Date, Time
      Locate_expression = .cbofield.value + ;
         .cboSign.vale + [{] + .txtcondition.value + [}]
      
    ...
  endcase
....
EndWith
6) Forward Search if unchange txtcondition and cbosign value. Done!
nRecno = Recno()
if Thisform.lastsearch == Locate_expression
  continue
else
  Locate for Locate_expression
  Thisform.lastsearch = Locate_expression
endif
if !found()
  go nRecno
  Wait Window "Fail to Locate!!"
endif
7) Finally, I wonder I cannot use 'Like' on Locate Command!!
Because I can:
Select * from myTable where key Like '%FC0_2%' into cursor tmp
to set the grid with special search
but normal locate will got error.
So, how to change [locate for key like '%FC0_2%']
into a valid locate command? Of cos, The difficulty is to put on
the orginal statement without affect others. )_('


^_^' Thanks many ppl here, most technique I wonder learn from here!!
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform