|
-
May 17th, 2006, 10:37 AM
#1
Thread Starter
Member
Please help with DBGrid
I've got an very irritating problem with DBgrid. Any help or advise will be highly appreciated
When opening form data loads into grid with other fields on form as well
Form looks like this
DBgrid: (only some colums as example)
Code: Description: Qty: Weight: AirCraft Type
A80 Magnesium Hydrate 2 3Kg FORBIDDEN
A5 Battery Acid 10 1.5kg Passenger
A78 Fire Extinguisher 1 .5kg Passenger
A12 Lithuim Battery 2 .2kg Passenger
Item 1 Forbidden on aircraft:
Private Sub lblEdit_Click()
'Forbidden item on Passenger and/or Cargo Aircraft
If DBGrid1.Columns("Pass Cargo Pack Instr").Text = "FORBIDDEN" Then
MsdgBox "Item is forbidden on Any Aircraft"
Exit Sub
End If
Data3.UpdateRecord
End Sub
Private Sub lblPrint_Click()
'Forbidden item on Passenger and/or Cargo Aircraft
If DBGrid1.Columns("Pass Cargo Pack Instr").Text = "FORBIDDEN" Then
MsdgBox "Item is forbidden on Any Aircraft - Canot Print Documentation"
Exit Sub
End If
CrystalReport3.SelectionFormula = "{ControlHeadA.ControlNo} = " & txtControl.Text
CrystalReport3.PrintReport
End Sub
Problem is that this works only when FORBIDDEN appears in the 1st row in the DBGrid
When Forbidden appears after the first row it ignores the message and update the database and print the documentation
A5 Battery Acid 10 1.5kg Passenger
A78 Fire Extinguisher 1 .5kg Passenger
A80 Magnesium Hydrate 2 3Kg FORBIDDEN
A12 Lithuim Battery 2 .2kg Passenger
How do I check for FORBIDDEN anywhere in the DBGrid column
I need to sort grid by carton number and other criteria so sorting to get FORBIDDEN in the 1st row is not an option
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|