T
TNL
Hi,
I have a unbound form, that is opened as modal.
On this form there is a commandbutton, this open 2. modal form. The code is following
Private Sub cmdCustomerSearch_Click()
Dim lID As Long
If SearchId(lID) = True Then
CustomerId.Value = lID
CustomerId.SetFocus
End If
end sub
private function SearchID(lID as long) as boolean
sFormname = "frmSearch"
If IsFormLoaded(1, sFormname, False) Then
DoCmd.Close acForm, sFormname
End If
DoCmd.OpenForm sFormname, , , , , acDialog, sOpenargs
If IsFormLoaded(sFormname) Then
lID = Forms(sFormname).Id
DoCmd.Close acForm, sFormname
End If
.....
end sub
But after closing the 2. form (frmSearch), the system (access) is locked, I can't do anything more, it beep only. From VBA code windows, I can still close the 1. form with command docmd.close...
It is surprised, when I run the code in debug (break) modus at the line "If SearchId(lID) = True Then", then I can still work with the 1. form, but when I close this form, the system is locked again)
Why? Can anybody help me?
Thanks
TNL
I have a unbound form, that is opened as modal.
On this form there is a commandbutton, this open 2. modal form. The code is following
Private Sub cmdCustomerSearch_Click()
Dim lID As Long
If SearchId(lID) = True Then
CustomerId.Value = lID
CustomerId.SetFocus
End If
end sub
private function SearchID(lID as long) as boolean
sFormname = "frmSearch"
If IsFormLoaded(1, sFormname, False) Then
DoCmd.Close acForm, sFormname
End If
DoCmd.OpenForm sFormname, , , , , acDialog, sOpenargs
If IsFormLoaded(sFormname) Then
lID = Forms(sFormname).Id
DoCmd.Close acForm, sFormname
End If
.....
end sub
But after closing the 2. form (frmSearch), the system (access) is locked, I can't do anything more, it beep only. From VBA code windows, I can still close the 1. form with command docmd.close...
It is surprised, when I run the code in debug (break) modus at the line "If SearchId(lID) = True Then", then I can still work with the 1. form, but when I close this form, the system is locked again)
Why? Can anybody help me?
Thanks
TNL