Arsip: menampilkan selected data di datagrid menggunakan textedit
more 13 years ago
lukersgn
procedure TFormEmpIndex.edSearchChange(Sender: TObject);
begin
if edCategory.Text <> '' then
begin
case edCategory.ItemIndex of
0 : qEmployee.Locate('EMP_NR', edSearch.Text, [loPartialKey,
loCaseInSensitive]);
1 : qEmployee.Locate('CONTRACT_NO', edSearch.Text,[loPartialKey,
loCaseInsensitive]);
else
qEmployee.Locate('GIVEN_NAME', edSearch.Text, [loPartialKey,
loCaseInSensitive]);
end;
end;
end;
mohon bantuannya,,thanks yah,,,
more 13 years ago
elva_ivana
@lukersgn ... mohon diperjelas maksud dan tujuanmu, apa yang diharapkan daro Code yang sudah dibuat atau apa masalah daro Code yang sudah dibuat.. biar rekan-rekan disini lebah enak bantunya ....
more 13 years ago
madi
mungkin kamsudnya kek gini :
procedure TFormEmpIndex.edSearchChange(Sender: TObject);
begin
if edCategory.Text <> '' then
begin
case edCategory.ItemIndex of
0 : 'SELECT FROM TABLE ANU WHERE EMP_NR = '+ QuoteStr(edSearch.text)';
//qEmployee.Locate('EMP_NR', edSearch.Text, [loPartialKey,
//loCaseInSensitive]);
1 : 'SELECT FROM TABLE ANU WHERE CONTRACT_NO = '+ QuoteStr(edSearch.text)';
//qEmployee.Locate('CONTRACT_NO', edSearch.Text,[loPartialKey,
//loCaseInsensitive]);
else
'SELECT * FROM TABLE ANU WHREE GIVEN_NAME = '+ quoteStr(edSearch.text)';
//qEmployee.Locate('GIVEN_NAME', edSearch.Text, [loPartialKey,
//loCaseInSensitive]);
end;
end;
end;
more 13 years ago
iwancs
edCategory itu text edit atau combobox yah?text edit gak ada property ItemIndex. Saya anggap maksudnya edCategory itu adalah combobox, karena itu yang paling tepat untuk keperluan anda.
Kalo gak salah tangkep seh, maksudnya pengen tampilin data di grid berdasarkan informasi yang di isi di edSearch.text untuk kategori yang di definisikan di edCategory.
Cara anda sudah benar kok, jadi ada kendala di mana yah?
Pastikan saja qEmployee dihubungkan ke grid jadinya hasil dapat langsung di lihat. Kalo saya lebih suka mempergunakan filter, tekniknya sama seh, hanya saja, data yang ditampilkan jadi semakin sedikit. Tapi itu tergantung kebutuhan.
@lukersgn: procedure TFormEmpIndex.edSearchChange(Sender: TObject); begin if edCategory.Text <> '' then begin case edCategory.ItemIndex of 0 : qEmployee.Locate('EMP_NR', edSearch.Text, [loPartialKey, loCaseInSensitive]); 1 : qEmployee.Locate('CONTRACT_NO', edSearch.Text,[loPartialKey, loCaseInsensitive]); else qEmployee.Locate('GIVEN_NAME', edSearch.Text, [loPartialKey, loCaseInSensitive]); end; end; end; mohon bantuannya,,thanks yah,,,
more ...
- Pages:
- 1
reply |
Report Obsolete
Last Articles
Last Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 4 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 5 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 12 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 12 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 12 years ago
Random Topic
- Ngasih Warna di Detail Data Fastreport
by supermuam in Reporting more 15 years ago - cetak laporan bulanan dan tahuna Quick report dengan query
by d3n1bgt in Tip n Trik Pemrograman more 14 years ago - simpan image ke database mysql
by hendra23 in MySQL more 16 years ago - [Help] Form dgn Back dan Next button
by wahjoew in Hal umum tentang Pascal Indonesia more 17 years ago - mau tanya TmxAnyExport
by toing in Tip n Trik Pemrograman more 16 years ago - Mohon Petuahnya (Query di Stroreprocedure)
by supermuam in MsSQL more 15 years ago - Pertanyaan Mudah Tapi Sulit....
by juan81 in Multimedia & Graphic Enhancement more 18 years ago - Buka file pdf
by bboyz in Hal umum tentang Pascal Indonesia more 17 years ago - kode ascii
by tamara in Delphi.NET more 15 years ago - gimana bikin format 001 di fast report 3.xx
by oloan_ac in Reporting more 16 years ago