Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

first record is selected automatically to delete

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-15-2010, 07:07 AM
aru aru is offline
Junior Member
 
Join Date: Feb 2010
Posts: 24
Default first record is selected automatically to delete

Hi I need a help,

I created a program for search result,
Here I have two button. 1) SEARCH 2 ) DELETE

When I click on search, all record will be displayed in the table.

And I can select a record to delete.
But If I am not select a record, and when I click on delete button, First record is deleted automatically or
first record is selected automatically to delete.

I don't want that type of deletion, deletion only after select a record.



My code is give below.
I want this program as when I press delete button, with out selection any record, any record won't be deleted.

Sub deleteStudent_Click
If SearchingStudent.RowCount <= SearchingStudent.SelectedRow Then Return
name = SearchingStudent.Cell (SearchingStudent.ColName(1),SearchingStudent.Sele ctedRow)
address = SearchingStudent.Cell (SearchingStudent.ColName(2),SearchingStudent.Sele ctedRow)
Msgbox(name)
Msgbox(address)
End Sub


Thanks and regards
Aru
Reply With Quote
  #2 (permalink)  
Old 03-15-2010, 08:49 AM
Basic4ppc Expert
 
Join Date: May 2008
Location: Berkshire, UK
Posts: 810
Awards Showcase
Beta Tester 
Total Awards: 1
Default

It is probably easiest to have a global variable used as a boolean with meaning "record selected". You set it to false at program start and to true only when you have decided that a record has been selected.

Then test this variable before performing the deletion. Maybe if variable is false, show a message box saying "No explicit selection", or similar. Of course if the record is deleted then the variable must be set to false again!

HTH, Mike.
Reply With Quote
  #3 (permalink)  
Old 03-15-2010, 02:24 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 1,057
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Have a look at my sample in the following post.

Of course it was a slightly different question, but if you take away one table you'll get a solution for you problem, too.


specci48
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
table record Maxium scott93727 Questions (Windows Mobile) 1 05-27-2008 09:46 AM
Automatically Open Pword With A Word File sintaq Questions (Windows Mobile) 3 03-26-2008 02:31 PM
Delete a row in a table and simultaneously delete it in the database gonzamax Questions (Windows Mobile) 2 12-25-2007 01:23 PM
Delete Control and Delete Form Items alfcen Basic4ppc Wishlist 3 10-05-2007 12:09 PM
Screen orientation changes automatically? mwaite Questions (Windows Mobile) 3 05-01-2007 06:53 PM


All times are GMT. The time now is 10:46 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0