I encounter problem when I try to update/change data selected through "edit" form. The macro return error message as " Runtime error 13 -Type mismatch" when button change was click. Is there anything wrong with the code ? Please assist.
Thank you
I encounter problem when I try to update/change data selected through "edit" form. The macro return error message as " Runtime error 13 -Type mismatch" when button change was click. Is there anything wrong with the code ? Please assist.
Thank you
I don't get an error. It doesn't seem to work, but it doesn't error. What data should I try to force an error?
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
The error will appear if select any item in list box and click on edit selection button. After change of data in edit form and click image icon for update to worksheet("ALLSSE"). Error pointed at the following code ".Cells(Me.Tbname.Value, "B").Value = Me.Tbname.Value "
Didn't realise the picture was a button!
[vba]
Private Sub Img_cmdchange_Click()
With Worksheets("ALLSSE")
.Cells(FrmMain.ListBox1.ListIndex + 2, "B").Value = Me.Tbname.Value
.Cells(FrmMain.ListBox1.ListIndex + 2, "c") = Me.TbcsdsNo.Value
.Cells(FrmMain.ListBox1.ListIndex + 2, "D") = Me.Tbname.Value
.Cells(FrmMain.ListBox1.ListIndex + 2, "E") = Me.TbWdnBy.Value
.Cells(FrmMain.ListBox1.ListIndex + 2, "F") = Me.Tbwdnreason.Value
.Cells(FrmMain.ListBox1.ListIndex + 2, "G") = Me.TbCACAuth.Value
.Cells(FrmMain.ListBox1.ListIndex + 2, "H") = Me.TbacctNo.Value
.Cells(FrmMain.ListBox1.ListIndex + 2, "I") = Me.Tbdateout.Value
End With
Unload Me
Cells.Sort Key1:=Range("B2"), Order1:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom
End Sub
[/vba]
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
Thanks Xld. You are great !