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

Form Not Opening

Status
Not open for further replies.

Lacybug

Technical User
Jul 15, 2004
4
US
I have a form that I created in Access 2003. For some reason I can not open it nor can I go into the design of it.

I keep getting a message that "I canceled the previous operation."

Please help!
 
If there is VBA behind the form, please post it. A few things to try:
Make sure the recordsource is still valid and that it contains data.
Try a compact & repair.
Possibly decompile/recompile - see here:


An làmb a bheir, ‘s i a gheibh.
 
I think it has something to do with this too....

Private Sub Command17_Click()
On Error GoTo Err_Command17_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Job Details Subform 2"

stLinkCriteria = "[Job Details.JobID]=" & Me![Job ID #]
DoCmd.Openform stDocName, , , stLinkCriteria

Exit_Command17_Click:
Exit Sub

Err_Command17_Click:
MsgBox Err.Description
Resume Exit_Command17_Click

End Sub
 
If Me![Job ID #] is not a numeric field, it needs to be enclosed in single quotes.

An làmb a bheir, ‘s i a gheibh.
 
Also, you don't need to use the table reference if JobID from the Job Details table is the only JobID in the form's record source. But, you also have a problem with the table reference as it has a space and therefore would need square brackets (your bracketing is incorrect).

So this:

stLinkCriteria = "[Job Details.JobID]=" & Me![Job ID #]

Should be this:

stLinkCriteria = "[Job Details].[JobID]=" & Me![Job ID #]


And you should not use SPACES or SPECIAL CHARACTERS (except underscores and even then I'd avoid them) in your field and object names.

Bob Larson
FORMER Microsoft Access MVP (2008-2009, 2009-2010)
Free Tutorials/Samples/Tools:
 
How are ya Lacybug . . .
Lacybug said:
[blue]For some reason I can not open it [red]nor can I go into the design of it[/red].[/blue]
This is indicitive of corruption! I can see the form throwing errors but not being able to get into designview is really bad.

For test purposes make ([red]do not copy[/red]) the form under another name ([red]no spaces in the name[/red]). Then see if you can open the form and get into design view directly from the forms window. If all is ok ... make another button in your calling form and see if that works. [green]Let us know the results.[/green]

As far as the code you've given ... it looks typical of the command button wizard, however I've never known or heard of this wizard inserting table names. For the control [blue][Job ID #][/blue] I'd be interested in knowing what the [blue]Name[/blue] property reveals. But since you can't get into design view ... its why I'm asking you to reconstruct the form.

In parallel with [blue]boblarson[/blue], you've got to get those spaces out of your naming convention or your headed for more trouble. Although you can take of the problem using brackets [blue][][/blue] it causes code to have to be [red]deciphered[/red] instead of read.

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top