Jumat, 17 Mei 2013

[MS_AccessPros] Re: Event procedure does not work in compiled accde

 

Shot in the dark, I just ran Windows Update on the troublesome computer, restarted, deleted the local copy of the front end file, copied over the one on the server, and tried again. Worked this time.

Let's cross our fingers...

--- In MS_Access_Professionals@yahoogroups.com, "Amanda B" <amandabyrne@...> wrote:
>
> Well, I made some progress by installing this update:
>
> http://www.microsoft.com/en-us/download/details.aspx?id=28521
>
> which supposedly updates the VBE7.dll from version 7.0 to 7.1
>
> This corrected the problem on one of the user computers, but not the other one. (1 step forward, 2 steps back...)
>
> --- In MS_Access_Professionals@yahoogroups.com, "Amanda B" <amandabyrne@> wrote:
> >
> > Curses!
> >
> > I went to copy the working accde file to the other client computers, and when I open it on those computers, and open the form I've been working on, I get this error:
> >
> > "The database cannot be opened because the VBA project contained in it cannot be read"... then it wants to delete the VBA project and remove all code from forms.
> >
> > When I open the database from the client pc and immediately try to compact and repair, I get the same message.
> >
> > Machines are running the same version of Access and the same OS.
> >
> > Is it always this difficult? What next?
> >
> > --- In MS_Access_Professionals@yahoogroups.com, "Amanda B" <amandabyrne@> wrote:
> > >
> > > Hurray! I tried the decompile and recompile per the instructions (including the compact and repair part), I have made an accde, copied it to the local location, and the search works!
> > >
> > > Now to see if anything else broke. :)
> > >
> > > --- In MS_Access_Professionals@yahoogroups.com, "Bill Mosca" <wrmosca@> wrote:
> > > >
> > > > Maybe something broke. Try my advice earlier about decompiling.
> > > >
> > > > Bill
> > > >
> > > > --- In MS_Access_Professionals@yahoogroups.com, "Amanda B" <amandabyrne@> wrote:
> > > > >
> > > > > Oops, spoke too soon- worked fine in the master database, but it doesn't work in the compiled accde
> > > > >
> > > > > --- In MS_Access_Professionals@yahoogroups.com, "Bill Mosca" <wrmosca@> wrote:
> > > > > >
> > > > > > Amanda
> > > > > >
> > > > > > No need to use the RecordsetClone or requery the combo. This should work.
> > > > > >
> > > > > > Private Sub ComboSearchNames_Click()
> > > > > > Me.Recordset.FindFirst "[Animal ID] =" & Me.ComboSearchNames
> > > > > > Me.txtString = Null
> > > > > > End Sub
> > > > > >
> > > > > >
> > > > > >
> > > > > > --- In MS_Access_Professionals@yahoogroups.com, "Amanda B" <amandabyrne@> wrote:
> > > > > > >
> > > > > > > Good news! I have discovered how to get my textbox to fill in my dropdown. I used the method described here:
> > > > > > >
> > > > > > > http://stackoverflow.com/questions/2871155/filtering-a-listbox-based-on-combobox-selection
> > > > > > >
> > > > > > > After compiling- this worked like a charm
> > > > > > >
> > > > > > > However, the code that refreshed the form with the selected dropdown option is not working, so I'm moving on to next problem...
> > > > > > >
> > > > > > > I think it's the same code for the ComboSearchNames_Click() event that causes the form to refresh- so why wouldn't this be working?
> > > > > > >
> > > > > > > --- In MS_Access_Professionals@yahoogroups.com, "Amanda B" <amandabyrne@> wrote:
> > > > > > > >
> > > > > > > > I recently converted to a split database due to errors we were encountering with multiple users. The backend resides on the server, and the front end accde file resides on local machines.
> > > > > > > >
> > > > > > > > The split database master file I used to create the front end does not report any errors with I use Debug>Compile in the VBA
> > > > > > > >
> > > > > > > > However, there is a key event procedure on one of the forms that does not function when I make the accde version of the database. It is a textbox named txtString. Users use this textbox to search records and populate a drop down based on the text entered, and thus populate the form.
> > > > > > > >
> > > > > > > > The code for the txtString AfterUpdate is:
> > > > > > > >
> > > > > > > > Private Sub txtString_AfterUpdate()
> > > > > > > > Dim strQuery As String
> > > > > > > > strQuery = "SELECT [Animal Records].[Animal ID], [Animal Records].[House Name], [Animal Records].[Aliases] FROM [Animal Records] WHERE ([Animal Records].[House Name] LIKE '*" & Me!txtString.Value & "*'OR [Animal Records].[Aliases] LIKE '*" & Me!txtString.Value & "*') ORDER BY [Animal Records].[House Name];"
> > > > > > > > Me!ComboSearchNames.RowSource = strQuery
> > > > > > > > Me!ComboSearchNames.Visible = True
> > > > > > > > End Sub
> > > > > > > >
> > > > > > > > The code for the related Combo SearchNames dropdown OnClick event is:
> > > > > > > >
> > > > > > > > Private Sub ComboSearchNames_Click()
> > > > > > > > Me.RecordsetClone.FindFirst "[Animal ID] =" & Me.ComboSearchNames
> > > > > > > > Me.Bookmark = Me.RecordsetClone.Bookmark
> > > > > > > > Me.txtString = Null
> > > > > > > > Form.Refresh
> > > > > > > > Me.[ComboSearchNames].Requery
> > > > > > > > End Sub
> > > > > > > >
> > > > > > > > The Combo SearchNames RowSource is a query defined in the RowSource property (i.e. there is not a separate 'dedicated' query that it calls)
> > > > > > > >
> > > > > > > > Why would this not work in the compiled version? T
> > > > > > > >
> > > > > > > > Gratefully, Amanda
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (13)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar