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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find Record control use in Access 2003 causes error 1

Status
Not open for further replies.

justagrunt

Technical User
Oct 10, 2002
132
Greetings,
The thought of using backward compatible Access 2003 on an Access 2000 form made me try it.I have updated to 2003 to get the extra benifits and future proofing as older computre get updated. The original 2000 form has a find record control (established from the toolbox wizard). Trying to use this form, in 2003, i get an error that states a long the lines of record locked no information in control or database etc, cant use function at this time. Using the debugg says that the controls code of screen.previousrecord.setfocus refernece doesn't exist.
Things are sweet in 2000 no problems yet in 2003 drama.
Any suggestions as to why this may be occuring.
Regards
Bill
 
Hi,

The following code is what the wizard produces in access 2000 when selecting from the tool box to create a button.

Private Sub Find_Click()
On Error GoTo Err_Find_Click


Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_Find_Click:
Exit Sub

Err_Find_Click:
MsgBox Err.Description
Resume Exit_Find_Click

End Sub

This code is also produced in Access 2003.
When the form control is selected Access 2003 doesn't recognise the line in compile VBA.

Screen.PreviousControl.SetFocus

Yet when I put.
application.Screen.PreviousControl.SetFocus

Its happier. Yet, still the actioning of the control on the form is unsuccesful and I get an error that states a long the lines of record locked no information in control or database etc, cant use function at this time in the MDE format. The control works on XP office equipted machines and even on 2 other Office 2003 machines yet on my tin box I get error - Having said all this I may have a corrupt Office set up so will investigate.
Regards
Bill
 
How are ya justagrunt . . . . .

There is some direct [blue]objectivity[/blue] in Access 2003 that has problems. Tell me if this works:
Code:
[blue]Dim ctl as Control

Set ctl = Screen.PreviousControl

ctl.SetFocus[/blue]

Calvin.gif
See Ya! . . . . . .
 
Tried it "TheAceMan1" same result.
Had to alter the code to get it to compile as

Private Sub Command256_Click()
On Error GoTo Err_Command256_Click

Dim ctl As Control

Set ctl = Application.Screen.PreviousControl
ctl.SetFocus



Rem Screen.PreviousControl.SetFocus


DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_Command256_Click:
Exit Sub

Err_Command256_Click:
MsgBox Err.Description
Resume Exit_Command256_Click

End Sub


I have reinstalled office and service pack, and the original form I remade,that is to say i cut and paisted the controls across to a new form in design view, except for the wizard controls which I added after. So perplexed and lost.
I can get by with totally removing the find button from the form . This would solve this problem but still doesn't account why other forms have the same problem with my 2003 yet under access 2000 or just plain XP (opening as a 2000 default) no problem and other 2003 without the service pack work.
Regards
bill
 
justagrunt . . . . .

I was'nt sure if it would work or not . . . . .

I can't get to 2003 right now to setup simulation of the problem. This is certainly one of those ambiguities that has plagued quite a few people.

The fact you can get it to work on other 2003 without the service pak is certainly indicitive of the pak itself. Currently researching info on 2003 service paks. If I find anything, I'll post back . . . . .

Curious . . . . . do you show the same references when you run 2003 as 2000?

Calvin.gif
See Ya! . . . . . .
 
Hi TheAceMan1,
Cheers,
Haven't tried running 2003 as 2000 yet - the key is yet.
That will be next.
Now getting and activex problem.
Have reinstalled jet 4 service pack 8, the xml service pack and the mxcl 2.7 refresh for XP service pack 1 just in case.
Service pack 1 for 2003 only just came out, can't think of any other reason as yet- still tracking.
Now having activex problems where I believe I shouldn't, but thats in another post.
Warm Regards
bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top