Unable to link to split table in Access 2002

R

Richard James

The following code works in Access 2000, but does not
work in Access 2002. Error is ...

Method 'Connection' of object '_Current Project' failed.

Can you help me fix this? I'm using Windows XP on both
computers.

Thanks



Private Sub Form_Open(Cancel As Integer)
On Error GoTo err_form_open

10 'Print CurrentProject.Connection: Stop

Dim rst As New ADODB.Recordset
20 rst.Open "qryPropertyProfile",
CurrentProject.Connection, _
adOpenKeyset, adLockOptimistic
'Debug.Print rst!PropertyCode

txtTempPropCode.DefaultValue = rst!PropertyCode
TxtTempPropName.DefaultValue = rst!PropertyName
txtTempPropCode = rst!PropertyCode
TxtTempPropName = rst!PropertyName
'DoCmd.Close ("qryPropertyProfile")

DoCmd.Maximize
DoCmd.ShowToolbar "Form View", acToolbarNo
DoCmd.GoToRecord , , acNewRec
DoCmd.GoToControl "Location"
'DoCmd.ShowToolbar "Menu Bar", acToolbarNo
DoCmd.ShowToolbar "Web", acToolbarNo
Exit Sub

err_form_open:
MsgBox Err.Description

Resume exit_form_open

exit_form_open:
Exit Sub

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top