Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.databases.ms-access > #10979
| From | Ulrich Möller <knobbi38@arcor.de> |
|---|---|
| Newsgroups | comp.databases.ms-access |
| Subject | Re: AfterUpdate Code causes Access failure ("Microsoft Access has stopped working") |
| Date | 2015-08-10 13:48 +0200 |
| Organization | A noiseless patient Spider |
| Message-ID | <mqa2um$map$1@dont-email.me> (permalink) |
| References | <f5d96247-5024-4736-a974-b399d67f3583@googlegroups.com> |
Am 09.08.2015 um 08:04 schrieb magmike:
> I know this might sound strange, but when I first open my database (ProspecForm opens), if I choose to use the CompanyFind dropdown/combo box on the form to to choose the record ProspectForm will populate with, it causes "Microsoft Access has stopped working". However, if I first cycle through a record or two using the navigation buttons, and then use the CompanyFind dropdown/combo box, it is fine the rest of the time the database is open.
>
> Here is the offending code:
>
> Private Sub CompanyFind_AfterUpdate()
> Dim rs As Object
> If Me.CompanyFind.Column(3) > 0 Then
> Set rs = Me.Recordset.Clone
> rs.FindFirst "[ID] = " & Str(Nz(Me![CompanyFind].Column(3), 0))
> If Not rs.EOF Then Me.Bookmark = rs.Bookmark
> Else:
> MyCompanySearch
> End If
> End Sub
>
>
>
> Any ideas?
>
> Thanks in advance for your help,
> magmike
Maybe you have some timing issues. The records in the combobox will be
loaded asynchronously to the rest of the form. I don't know how many
records will be loaded into your combo so it might took a little while.
Try to force loading the recordset from the combo in the CompanyFind
enter_event with:
lngReccordCounts = CompanyFind.ListCount
and second, a modification of the original code to a more common usage:
Private Sub CompanyFind_AfterUpdate()
Dim rs As DAO.Recordset
If nz(Me.CompanyFind.Column(3),0) > 0 Then
Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Cstr(Nz(Me![CompanyFind].Column(3), "0"))
if rs.NoMatch Then
MyComanySearch
else
Me.Bookmark = rs.Bookmark
End If
end if
set rs = Nothing
End Sub
At first you should try it without the code in the enter event and if it doesn't work for you, add the given code for the enter event and try it again.
Ulrich
Back to comp.databases.ms-access | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
AfterUpdate Code causes Access failure ("Microsoft Access has stopped working") magmike <magmike7@yahoo.com> - 2015-08-08 23:04 -0700
Re: AfterUpdate Code causes Access failure ("Microsoft Access has stopped working") Ulrich Möller <knobbi38@arcor.de> - 2015-08-10 13:48 +0200
Re: AfterUpdate Code causes Access failure ("Microsoft Access has stopped working") "Ron Paii" <None@none.com> - 2015-08-10 07:11 -0500
Re: AfterUpdate Code causes Access failure ("Microsoft Access has stopped working") Ulrich Möller <knobbi38@arcor.de> - 2015-08-10 14:39 +0200
Re: AfterUpdate Code causes Access failure ("Microsoft Access has stopped working") "Ron Paii" <None@none.com> - 2015-08-12 08:02 -0500
Re: AfterUpdate Code causes Access failure ("Microsoft Access has stopped working") Ulrich Möller <knobbi38@arcor.de> - 2015-08-12 18:47 +0200
Re: AfterUpdate Code causes Access failure ("Microsoft Access has stopped working") magmike <magmike7@yahoo.com> - 2015-08-11 07:54 -0700
Re: AfterUpdate Code causes Access failure ("Microsoft Access has stopped working") magmike <magmike7@yahoo.com> - 2015-08-11 09:32 -0700
Re: AfterUpdate Code causes Access failure ("Microsoft Access has stopped working") Ulrich Möller <knobbi38@arcor.de> - 2015-08-12 01:54 +0200
Re: AfterUpdate Code causes Access failure ("Microsoft Access has stopped working") Patrick Finucane <patrickfinucanetx@gmail.com> - 2015-08-11 12:30 -0700
csiph-web