By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,950 Members | 1,005 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,950 IT Pros & Developers. It's quick & easy.

Error accessing file?

P: n/a
GCM
I have a database which was created from another parent database by
combining some fields into one field for clerification purposes. When I
create a for with the following command I get this error:

Error accessing file. Network connection may have been lost.

Following is the function I use. Eveything else works fine. This function
worked on the parent database. The form data is linked to the proper table:

-------------------------------------------------
Private Sub Search_Click()
On Error GoTo Err_Search_Click
Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_Search_Click:
Exit Sub

Err_Search_Click:
MsgBox Err.Description
Resume Exit_Search_Click

End Sub
--------------------------------------------------

Thanks in advance...
gcm
Aug 17 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
First, take off this line:
Screen.PreviousControl.SetFocus

Then, do a repair/compact on the database and try it again. If it
works, try adding that line back into the sub.

GCM wrote:
I have a database which was created from another parent database by
combining some fields into one field for clerification purposes. When I
create a for with the following command I get this error:

Error accessing file. Network connection may have been lost.

Following is the function I use. Eveything else works fine. This function
worked on the parent database. The form data is linked to the proper table:

-------------------------------------------------
Private Sub Search_Click()
On Error GoTo Err_Search_Click
Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_Search_Click:
Exit Sub

Err_Search_Click:
MsgBox Err.Description
Resume Exit_Search_Click

End Sub
--------------------------------------------------

Thanks in advance...
gcm
Aug 17 '06 #2

P: n/a
GCM
ManningFan,

Thanks for the suggestion, but that didnt work either. When I deleted the
line from the command, nothing would work. Icouldn't save the form or
compact the database. I appreciate your efforts very much.

Thanks,
gcm

"ManningFan" <ma********@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
First, take off this line:
Screen.PreviousControl.SetFocus

Then, do a repair/compact on the database and try it again. If it
works, try adding that line back into the sub.

GCM wrote:
>I have a database which was created from another parent database by
combining some fields into one field for clerification purposes. When I
create a for with the following command I get this error:

Error accessing file. Network connection may have been lost.

Following is the function I use. Eveything else works fine. This function
worked on the parent database. The form data is linked to the proper
table:

-------------------------------------------------
Private Sub Search_Click()
On Error GoTo Err_Search_Click
Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_Search_Click:
Exit Sub

Err_Search_Click:
MsgBox Err.Description
Resume Exit_Search_Click

End Sub
--------------------------------------------------

Thanks in advance...
gcm

Aug 19 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.