MS help

  • Thread starter Thread starter Yomi
  • Start date Start date
Y

Yomi

I am working with userform and I want to double-click records in a list box
such that and update window could come up,so that I can edit the records.Can
someone help
 
one way would be to add a textbox - visible = false to a new userfor. set the
listbox's event to load the form, populate the text box then chow the form
habe a cancel button and an ok button - these set a public boolean to false
or true then hide the form. the callign routine does nothing but unloads the
form. the true updates the listbox

userform1
objecys: listbox1
code:

Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Load UserForm2
UserForm2.TextBox1 = Me.ListBox1.Value
UserForm2.Show

If UserForm2.bUpdate Then
' update
End If
Unload UserForm2


End Sub

userform2
object: btnOK, BbtnCancel, textbox1
code:
Option Explicit
Public bUpdate As Boolean

Private Sub bntCancel_Click()
Me.Hide
End Sub

Private Sub btnOK_Click()
bUpdate = True
Me.Hide
End Sub


"Yomi" w
rote:
 
What I want to achieve is that for a list box(columncount-1) showing many
rows and columns, I should be able to click a row and when I do this a form
containg text boxes representing the fields(columns) in the record should
appear. I should then be able to edit the field and update the original
document
 
Back
Top