+ Reply to Thread
Results 1 to 30 of 30

UserForm Listbox issue

Hybrid View

  1. #1
    Registered User
    Join Date
    08-10-2005
    Posts
    56

    Variables

    Dave,

    It was my attempt, to create the form. As I am not sure what I need to do for it I have made up some code playing around, so the variable might not be needed.

    I need the double click event to display all the data for the select user in the frmmember userform. There are a number of fields, which need to be populated.

    Bach

  2. #2
    Dave Peterson
    Guest

    Re: UserForm Listbox issue

    You can pick out the data from the line you double clicked by using lines like:

    'or pick it up from the member_list worksheet
    ListType = CLng(mySelectedCell.Offset(0, 8).Value)



    bach wrote:
    >
    > Dave,
    >
    > It was my attempt, to create the form. As I am not sure what I need to
    > do for it I have made up some code playing around, so the variable might
    > not be needed.
    >
    > I need the double click event to display all the data for the select
    > user in the frmmember userform. There are a number of fields, which
    > need to be populated.
    >
    > Bach
    >
    > --
    > bach
    > ------------------------------------------------------------------------
    > bach's Profile: http://www.excelforum.com/member.php...o&userid=26134
    > View this thread: http://www.excelforum.com/showthread...hreadid=468634


    --

    Dave Peterson

  3. #3
    Registered User
    Join Date
    08-10-2005
    Posts
    56

    Further information

    Dave,

    Could you tell me what that line of code is doing, what is the offset for.

    What should the listtype variable be set to, it is currently set to string for data but I get an error message of type mismatch.

    Bach

    I have played with the number is the offset setting the column number?

  4. #4
    Dave Peterson
    Guest

    Re: UserForm Listbox issue

    You have a variable named ListType in your original code--but you didn't say
    where it came from.

    This was your code:

    Select Case ListType
    Case 1 'Members
    Set ws = Worksheets("Member_list")
    irow = ws.Cells(Rows(lstSelect & ":" & lstSelect))
    MemberType = 3
    Load frmMember
    frmMember.txtMemID.Value = irow
    Case 2 'Deacons
    ws = Worksheets("Deacon_list")
    End Select

    I guessed that when you double clicked on an entry that you wanted something
    from the same row. And since you had "case 1" and "case 2", I figured that
    listtype had to be a number.

    Since I had nothing to go by, I guessed that maybe it was 8 columns to the right
    of that double clicked value.

    ListType = CLng(mySelectedCell.Offset(0, 8).Value)

    These were just guesses and would only be useful as a sample--I have no idea how
    your data looks.

    bach wrote:
    >
    > Dave,
    >
    > Could you tell me what that line of code is doing, what is the offset
    > for.
    >
    > What should the listtype variable be set to, it is currently set to
    > string for data but I get an error message of type mismatch.
    >
    > Bach
    >
    > I have played with the number is the offset setting the column number?
    >
    > --
    > bach
    > ------------------------------------------------------------------------
    > bach's Profile: http://www.excelforum.com/member.php...o&userid=26134
    > View this thread: http://www.excelforum.com/showthread...hreadid=468634


    --

    Dave Peterson

  5. #5
    Registered User
    Join Date
    08-10-2005
    Posts
    56

    The Program

    Dave,

    I have taken some pictures, hopefully this will help you understand.

    Member Details form
    Sheet data
    Member List

    The member details userform is the first image this is where all the details for a user is enetered. This is then added to the spreadsheet "MemberList" which can be seen in the second image. Finally the last image is the member list which shows all users on the system.

    The double click event needs to open the member details form and populate all the fields in it with the data stored for that record in the spread sheet image 2.

    Does this help.
    ??

    Bach

  6. #6
    Dave Peterson
    Guest

    Re: UserForm Listbox issue

    I'm sorry. I don't open attachments or go off to other sites to look at
    pictures.

    Maybe someone else will jump in.

    bach wrote:
    >
    > Dave,
    >
    > I have taken some pictures, hopefully this will help you understand.
    >
    > 'Member Details form' (http://www.starwithin.co.uk/memberdetails.gif)
    > 'Sheet data' (http://www.starwithin.co.uk/spreadsheet.gif)
    > 'Member List' (http://www.starwithin.co.uk/memberlist.gif)
    >
    > The member details userform is the first image this is where all the
    > details for a user is enetered. This is then added to the spreadsheet
    > "MemberList" which can be seen in the second image. Finally the last
    > image is the member list which shows all users on the system.
    >
    > The double click event needs to open the member details form and
    > populate all the fields in it with the data stored for that record in
    > the spread sheet image 2.
    >
    > Does this help.
    > ??
    >
    > Bach
    >
    > --
    > bach
    > ------------------------------------------------------------------------
    > bach's Profile: http://www.excelforum.com/member.php...o&userid=26134
    > View this thread: http://www.excelforum.com/showthread...hreadid=468634


    --

    Dave Peterson

  7. #7
    Registered User
    Join Date
    08-10-2005
    Posts
    56
    Send to you directly ??

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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