On Click expression woes

razorkat99

Still figurin' it out
Local time
Today, 17:05
Joined
Oct 22, 2007
Messages
35
I have a form where I created a button to open a diff form w/in my db. The form I want to open contains a subform also, so I'm not sure if this is what is giving me grief. When I click on the button I receive the following error:

"The expression On Click you entered as the event property setting produced the following error: A problem occurred while Microsoft Access was communicating with the OLE server or ActiveX control...."

I have the following code associated with the button command:

Private Sub Command4_Click()
On Error GoTo Err_Command4_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "CustCallsDataEntry Frm"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command4_Click:
Exit Sub

Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click

End Sub

This same code, with the exception of the form names, is in another database and it works just fine.

Any thoughts?
 
DONT USE SPACES IN NAMES

It is probably the fact that you are using SPACES in the form name...

DONT USE SPACES IN NAMES

2 options

DONT USE SPACES IN NAMES

1) best option, delete the space

DONT USE SPACES IN NAMES

2) Try puting [] around the form name

DONT USE SPACES IN NAMES

Regards
 
I'm sorry did you say "DON'T USE SPACES IN NAMES?"

Pretty crass, but I get the point... even though I have never had a problem w/ spaces in my form names before.

At any rate, I removed the SPACE and it didn't work. Added the [] around the name and that didn't work either.
 
Sounds like it actually may not have to do with the code to open the form, but with the subform, or main form, itself.

If you can post a copy of the db here (after following these instructions: http://www.access-programmers.co.uk/forums/showthread.php?t=140587 )
Then we might be able to help track it down.

But, before you do - you don't happen to have Access 2003 with Service Pack 3 do you?
 

Users who are viewing this thread

Back
Top Bottom