Hi,
I have 2 forms (form1 and form2). Form 2 have 2 box.
Form1 will invoke form2 on a button click.
Form2 will collect data from the user, on clicking on "enter button" in the textbox2 in form2,and after that i need to unload form2.
But when I tried,
1.form2 is invoked
2.Details have been obtained
3.But while unloading
I got "The object invoked has been disconnected from client"
form1:
Private Sub CommandButton1_Click()
lr = Sheets(housenm).Range("A" & Rows.Count).End(xlUp).Row
For i = 1 To lr
If Sheets(housenm).Range("A" & i).Value = Lend.Lendnm.Value Then
Sheets(housenm).Range("B" & i).Value = Sheets(housenm).Range("B" & i).Value + Lend.Lendamt.Value
updst = "Updated"
End If
Next i
If Not updst = "Updated" Then
Sheets(housenm).Range("A" & lr + 1).Value = Lend.Lendnm.Value
Sheets(housenm).Range("B" & lr + 1).Value = Lend.Lendamt.Value
End If
Fromdet.Tag = Lend.Lendnm.Value
Intd = "Lend"
Intamt = Lend.Lendamt.Value
Unload Lend
Load Fromdet
Fromdet.Show
End Sub
form2:
Private Sub Fromdetamt_AfterUpdate()
lr = Sheets(housenm).Range("D" & Rows.Count).End(xlUp).Row
If Fromdet.fromdetfrm = "Locker" Then
Sheets("Lock").Range("D" & lr).Value = Date
Sheets("Lock").Range("E" & lr).Value = Me.Tag
Sheets("Lock").Range("F" & lr).Value = Fromdet.Fromdetamt
ElseIf Fromdet.fromdetfrm = "SBI" Then
Sheets("SBI").Range("D" & lr).Value = Date
Sheets("SBI").Range("E" & lr).Value = Me.Tag
Sheets("SBI").Range("F" & lr).Value = Fromdet.Fromdetamt
End If
Intamt = Intamt - Fromdet.Fromdetamt
If Intamt < 1 Then
Unload Fromdet
End If
End Sub
I am getting error in the "Fromdet.Show" in the form1.
Could anyone Please help.
Thanks,
navin.
Bookmarks