+ Reply to Thread
Results 1 to 10 of 10

Listbox issue + Setfocus after property Issue

  1. #1
    Forum Contributor
    Join Date
    09-05-2012
    Location
    Dubai
    MS-Off Ver
    Office 365
    Posts
    409

    Listbox issue + Setfocus after property Issue

    Hi Kindly help me solving my issue.

    Please refer attached macro, Its a small Project for a school.

    My issues :

    1. In the Userform1, If we enter a Previously assigned Admission No , it will show as its already assigned to some student which is correct Example Search for S01. but its set focus is lost, I want the set focus to be back on Admission_no

    2. In the Userform3, this is for viewing student history. I am unable to get the filtered data on the list box. which currently managed by copying the filtered data from sheet Student_data to another sheet Payment_ History and then displaying that full data on the listbox LS1. which is not feasible actually because I have another more filters to add-on like.
    Paid and outstanding to show on list box based on search type. (through command buttons Cleared and Outstanding on the userform) - Cleared should show filtered result taking the values of that rows where balance amount(column L) is Zero in the excel, and <>0 for Outstanding.

    so I need filtered data to show on listbox based on filter.

    Pls help me here.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Listbox issue + Setfocus after property Issue

    For Userform1 , not after update but in Exit

    Please Login or Register  to view this content.
    Kind regards
    Leo

  3. #3
    Forum Contributor
    Join Date
    09-05-2012
    Location
    Dubai
    MS-Off Ver
    Office 365
    Posts
    409

    Re: Listbox issue + Setfocus after property Issue

    Hi Leo, Superb yes its worked for me same I followed your code and changed to Exit. Thank a million.

    Appreciate if you could solve my 2nd issue as well with Listbox

  4. #4
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Listbox issue + Setfocus after property Issue

    no, i use also helper sheet
    other method is with loop and listbox.additem, but this is time consuming

    Kind regards
    Leo

  5. #5
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Listbox issue + Setfocus after property Issue

    Made dynamic named range and this codes for buttons
    in listbox properties
    change headers to true
    columnscount to 15

    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    09-05-2012
    Location
    Dubai
    MS-Off Ver
    Office 365
    Posts
    409

    Re: Listbox issue + Setfocus after property Issue

    Oh really cool... I have no words.. Fantabulous Leo thanks a million, you have made my day.

  7. #7
    Forum Contributor
    Join Date
    09-05-2012
    Location
    Dubai
    MS-Off Ver
    Office 365
    Posts
    409

    Re: Listbox issue + Setfocus after property Issue

    Hi Leo, Sorry for bothering again, Need help here in 2 things. pls refer my new attachment.

    1. Check Userform3 and Enter Student ID as S01 and search, then Click Outstanding, Then select a row and click Pay selected button , Here my issue comes.
    It acquiring correct row number and appearing in message box but its not passing the same value to the label Caption in Userform5.

    2. I Prefer to extend my listbox selection items to multi by changing the Listbox LS1 Multiselect option to frmMultiselect option, Here my Requirement is Selected Row numbers in the list box need to should in message box and also pass the values to an array.

    My idea is to use these array row numbers to accumulate outstanding of selected rows only and can be used to pay in userform5.

    Regards
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Listbox issue + Setfocus after property Issue

    No idee what result you expect in userform 5
    so lets say when you select student S01, choose outstanding, here you select rows 2 and 8
    witch result have to be in userform 5 ?

    you can enter this values manuel in new exemple ?

    Kind regards
    Leo

  9. #9
    Forum Contributor
    Join Date
    09-05-2012
    Location
    Dubai
    MS-Off Ver
    Office 365
    Posts
    409

    Re: Listbox issue + Setfocus after property Issue

    Hi Leo, thanks for comming back to me. I have dropped my Userform5 and added my requirement in Userform3 itself.
    and also dropped idea of using multi selection in listbox, A workaround made with single selection only to clear outstanding clearance and its ok now. pls refer my new attachment.

    Currently we can play around with all the records with the existing data only.

    I have a very strange requirement pending and hope you can help me in this pls.
    Its like, Every student has to pay their monthly Fee of 275 + Transportation fee of 75 for each month.
    some parents appear after 2, 3 or 4 months to pay their children monthly fees.
    so here comes my problem system should tell me the students pending months(which months they are due to pay)and their total amount,
    its driving me crazy,what should be my logic to make it possible.
    Attached Files Attached Files
    Last edited by naveenmarapaka; 03-26-2018 at 10:54 AM.

  10. #10
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Listbox issue + Setfocus after property Issue

    1 column with Name
    1 column with nr
    1 column with Date
    1 column for what has to be paid
    1 column for what is paid

    for every payment or new debt, one new row
    this is the only logic to work with in userforms and listboxes

    Kind regards
    Leo

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Userform ComboBox Issue - Invalid Property Value
    By Tooley in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-25-2016, 12:52 PM
  2. [SOLVED] Run Time Error Issue- Improper Property Value
    By Logit in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-28-2016, 08:30 AM
  3. User Form ListBox - Find Records (ListBox Populating Issue)
    By LONeillSSC in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 07-20-2015, 12:06 PM
  4. Conditional Formatting Issue With the Range Property
    By ankamshetti.nagaraj in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-25-2014, 03:57 AM
  5. User Form components' VISIBLE property issue
    By DaveS in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-18-2011, 04:53 PM
  6. Form, SetFocus and AfterUpdate issue
    By Piers 2k in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-08-2005, 09:55 AM
  7. ShowPivotTableFieldList Property - Version issue/ How to replicate?
    By Alan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-14-2005, 07:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1