Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Events/Execution Error problem

Status
Not open for further replies.

Tarnish

Technical User
Nov 13, 2006
221
US
Hi all,

I'm trying to test/implement some of the performance suggestions on Tony Toews access peformance faq found here:

One of the suggestions is to load recordSources and control sources at runtime. I've done that, at least in terms of the form and subform of the front tab of my main page. I already had setup something for subforms on the other tabs (they load when the tab is selected). I have NOT taken this faq all the way to the individual combo/listbox control level (yet).

According to the faq, you are then suppose to set the recordSource/control sources in question back to "" in the Form_unload event.

When I do that for the main form's recordSource, the Form_Current event fires immediately and my code breaks at lines such as this one:

If Forms!Files.cmbStatus = 2 Then
'blah blah blah
End If

...telling me "The expression you entered has a field, control, or property name that yourApp can't find"

It sort of make sense, because the recordSource is (I assume) now set to "". But I don't know how to get around this code breaking, and it's not just one line...there's a number of things I've got going on in the Form_Current event that are very similar to what I posted above..

I tried wrapping the Forms!Files.cmbStatus in the above code with Nz, as in Nz(Forms!Files.cmbStatus, 1), but that doesn't seem to do anything (and I really never thought it would).

Any help here??

Thanks,
T
 
I think maybe I fixed it. I think maybe the answer was so simple it stunned me. I just wrapped the entire form_current event in an if/then/else:

If Me.recordsource = "" Then
Exit Sub
Else

'All the previous code

End If
_____________

I'm hoping that won't cause other problems...

T
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top