LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Add/View/Update/Delete buttons

New to excel vba for userforms. I have a userform with two labels and
two textboxes. Label for Membership number (name=lMemNo), Label for
Name of the Distributor (name=lDistributor) Textbox for Membership
number (name=txtMemNo), Textbox for Name of the Distributor
(name=txtDistributor) and I have Six buttons Add (name=bAdd) View
(name=bView) Update (name=bUpdate) Delete (name=bDelete) Save
(name=bSave) and Show (name=bShow)

I need some of the macro experts to write small codes for each of these
buttons.

On form activate, both textboxes should be disabled.

If anybody clicks on Add button, both textboxes should be enabled,
after user enters values for txtMemNo and txtDistributor and clicks on
bSave, it should find the last row in sheet2 and save the values in the
textbox in column A and B respectively.

If anybody clicks on View button, only txtMemNo button should be
enabled. After entering a membership number, and clicking on bShow
button, it should show the respective name of the distributor in the
txtDistributor textbox (Disabled).

If anybody clicks on Update button, both textboxes should be enabled,
after user enters values for txtMemno, it should show the respective
name of the distributor in the txtDistributor texbox (Enabled). After
making any changes to either textbox and clicking on bSave, it should
change the previous record listed in the excel file with this new one.

If anybody clicks on Delete, only txtMemno button should be enabled.
After entering a membership number, it should promt "Are you sure you
want to delete - Yes/No" If Yes, delete it from the worksheet.

I tried searching some templates/samples on google but could not find
any.

Note: I have two sheets on my workbook. Sheet1 and Sheet2. I have kept
Sheet1 blank with gridlines off so that when the form is active, it
displays blank sheet behind. I want all my data in sheet2 and during
execution of any code, sheet2 should not be displayed. I don't want to
show my records to the user behind the form.

Sandy


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't delete buttons Angeline Excel Discussion (Misc queries) 3 October 18th 06 02:43 AM
Change Source / Update Now buttons not available stickboy Links and Linking in Excel 0 February 16th 06 10:33 PM
I can view links, but can't delete them Alifrog Links and Linking in Excel 4 February 16th 06 10:28 PM
Delete Buttons Bill Martin Excel Discussion (Misc queries) 2 February 11th 06 06:26 AM
can put buttons on same row as File Edit View Insert...? Ian Elliott Excel Discussion (Misc queries) 1 September 1st 05 08:10 PM


All times are GMT +1. The time now is 09:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"