473,394 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Form won't open

I have a form that I am unable to open. I had the form set to open on startup. It now will not open, even in design mode. I tried creating a form with a command button to open the form and it gives me an error code, "You canceled the previous operation." I tried copying the form and exporting the form. Neither work. All of the code for the form is still in the module. Any suggestions on how I open the form?

Thanks,
Jason
May 15 '10 #1
10 10994
NeoPa
32,556 Expert Mod 16PB
Try tracing the code of the form. Use Alt-F11 to switch to the debugger, then put a breakpoint in the code before trying to open the form normally. Trace through till you see why it is closing. See Debugging in VBA for detailed instructions.
May 15 '10 #2
I tried debugging. I also tried erasing all of the code in the form module. The form will still not open. I exported the entire database to another database but this form doesn't export and I cannot copy it.

Any other suggestions?

Thanks, Jason
May 15 '10 #3
NeoPa
32,556 Expert Mod 16PB
Sorry Jason. It sound like you have an unrecoverably corrupted form.

If you attach a copy (<= A2003 format) then I'll check it over for you, but my guess is that it's gone.
May 15 '10 #4
I've attached the database. One other thing that I noticed before this happened, my c drive was full and I was unable to save another word doc. I now have plenty of space on my hard drive but I'm wondering if this caused the issue.
Attached Files
File Type: zip c2.zip (894.0 KB, 127 views)
May 15 '10 #5
missinglinq
3,532 Expert 2GB
Apparently not, assuming that I'm correct in thinking that the form named 1 is the one you're referring to.

I can do nothing with it; cannot open it, cannot go into Design View, and cannot import it into another database.

I'm afraid that NeoPa's guess is correct, and that the form is gone!

Sorry!

Welcome to Bytes!

Linq ;0)>
May 16 '10 #6
Jim Doherty
897 Expert 512MB
@missinglinq
Same here:- compaction, decompilation and even running it through the Application.SaveAsText routine gave the 'reserved' error meaning it cannot write out the forms structure as text to an external file.

It is lost!
May 16 '10 #7
NeoPa
32,556 Expert Mod 16PB
I would be very confident that the lack of available space caused the corruption Jason. Unfortunately, if these boys have already found it beyond recovery, then my attempts are likely to find the same. I'll give it a go just because I promised to, but don't hold your breath. This is a dead parrot!
May 16 '10 #8
NeoPa
32,556 Expert Mod 16PB
Assuming the form referred to is 1 as Linq says, the code is not lost. I don't have it working of course, but hopefully the code is something to start with.
Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2.  
  3. Private Sub abc_click()
  4.     Me.CustList = Null
  5.     Me.CustList.Requery
  6.     Me.CustList = Me.CustList.ItemData(0)
  7.     Me.quotelist = Null
  8.     Me.quotelist.Requery
  9.     Me.quotelist = Me.quotelist.ItemData(1)
  10.     Me.ContactList = Null
  11.     Me.ContactList.Requery
  12.     Me.ContactList = Me.ContactList.ItemData(1)
  13. End Sub
  14.  
  15.  
  16. Private Sub Command80_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  17. [Help].Visible = True
  18. [Help] = "Update product names, customer numbers, add HAL personnel, etc..."
  19. End Sub
  20.  
  21. Private Sub Command91_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  22. [Help].Visible = True
  23. [Help] = "View reports on quotes, call reports, opportunites, contacts, etc..."
  24. End Sub
  25.  
  26. Private Sub custlist_AfterUpdate()
  27.     Me.quotelist = Null
  28.     Me.quotelist.Requery
  29.     Me.quotelist = Me.quotelist.ItemData(1)
  30.     Me.ContactList = Null
  31.     Me.ContactList.Requery
  32.     Me.ContactList = Me.ContactList.ItemData(1)
  33.     Me.SalesPersonList = Null
  34.     Me.SalesPersonList.Requery
  35.     Me.SalesPersonList = Me.SalesPersonList.ItemData(1)
  36.     Me.CallReportList = Null
  37.     Me.CallReportList.Requery
  38.     Me.CallReportList = Me.CallReportList.ItemData(1)
  39.  
  40.  
  41. End Sub
  42.  
  43. Private Sub NewCallReportCmd_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  44. [Help].Visible = True
  45. [Help] = "These include phone conversations, office visits and are designed to share information."
  46. End Sub
  47.  
  48. Private Sub NewContactCmd_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  49. [Help].Visible = True
  50. [Help] = "Add a new contact. The company name must be entered prior to adding a contact for the company."
  51. End Sub
  52.  
  53. Private Sub NewCustomerCmd_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  54. [Help].Visible = True
  55. [Help] = "Add a new customer. You cannot add a quote or contact if the customer is not listed above."
  56. End Sub
  57.  
  58. Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  59. [Help].Visible = False
  60. End Sub
  61.  
  62. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  63. [Help].Visible = False
  64. End Sub
  65.  
  66. Private Sub Form_Open(Cancel As Integer)
  67. If IsNull([Text69]) Then
  68. [Option56].Visible = False
  69. Else: [Option56].Visible = True
  70. End If
  71.  
  72. If IsNull([Text94]) Then
  73. [Option54].Visible = False
  74. Else: [Option54].Visible = True
  75. End If
  76.  
  77. If IsNull([Text93]) Then
  78. [Option58].Visible = False
  79. Else: [Option58].Visible = True
  80. End If
  81.  
  82. If IsNull([Text102]) Then
  83. [Option100].Visible = False
  84. Else: [Option100].Visible = True
  85. End If
  86.  
  87. If IsNull([Text103]) Then
  88. [Option104].Visible = False
  89. Else: [Option104].Visible = True
  90. End If
  91.  
  92. DoCmd.OpenQuery "notactiveupdate"
  93.  
  94. End Sub
  95.  
  96.  
  97.  
  98. Private Sub NewQuote_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  99. [Help].Visible = True
  100. [Help] = "Enter a new quote. Customers and contacts must be in the system prior to adding them to a quote."
  101. End Sub
  102.  
  103. Private Sub origin1_click()
  104.     Me.quotelist = Null
  105.     Me.quotelist.Requery
  106.     Me.quotelist = Me.quotelist.ItemData(1)
  107.  
  108. End Sub
  109. Private Sub activity_click()
  110.     Me.quotelist = Null
  111.     Me.quotelist.Requery
  112.     Me.quotelist = Me.quotelist.ItemData(1)
  113.  
  114. End Sub
  115.  
  116.  
  117. Private Sub PreviewReport_Click()
  118.  
  119.  
  120. On Error GoTo Err_PreviewReport_Click
  121.  
  122.     Dim stDocName As String
  123.  
  124.     stDocName = "quotes"
  125.  
  126.     If IsNull(forms![1]![QLnum]) Then
  127.     MsgBox "You must select a quote to view the report."
  128.     Else
  129.     DoCmd.OpenReport stDocName, acPreview
  130.  
  131.     End If
  132. Exit_PreviewReport_Click:
  133.     Exit Sub
  134.  
  135. Err_PreviewReport_Click:
  136.     MsgBox Err.Description
  137.     Resume Exit_PreviewReport_Click
  138.  
  139. End Sub
  140.  
  141.  
  142. Private Sub quotelist_DblClick(Cancel As Integer)
  143. DoCmd.Close acReport, "quotes"
  144. DoCmd.OpenReport "quotes", acPreview
  145. End Sub
  146. Private Sub EditQuote_Click()
  147. On Error GoTo Err_EditQuote_Click
  148.  
  149.     Dim stDocName As String
  150.     Dim stLinkCriteria As String
  151.  
  152.     stDocName = "Quotes Form"
  153.  
  154.     stLinkCriteria = "[Quote Number]=" & Me![QLnum]
  155.     DoCmd.OpenForm stDocName, , , stLinkCriteria
  156.  
  157. Exit_EditQuote_Click:
  158.     Exit Sub
  159.  
  160. Err_EditQuote_Click:
  161.     MsgBox Err.Description
  162.     Resume Exit_EditQuote_Click
  163.  
  164. End Sub
  165. Private Sub EditContact_Click()
  166. On Error GoTo Err_EditContact_Click
  167.  
  168.     Dim stDocName As String
  169.     Dim stLinkCriteria As String
  170.  
  171.     stDocName = "Contacts Form"
  172.  
  173.     stLinkCriteria = "[ContactID]=" & Me![ContactList]
  174.     DoCmd.OpenForm stDocName, , , stLinkCriteria
  175.  
  176. Exit_EditContact_Click:
  177.     Exit Sub
  178.  
  179. Err_EditContact_Click:
  180.     MsgBox Err.Description
  181.     Resume Exit_EditContact_Click
  182.  
  183. End Sub
  184. Private Sub NewQuote_Click()
  185. On Error GoTo Err_NewQuote_Click
  186.  
  187.     Dim stDocName As String
  188.     Dim stLinkCriteria As String
  189.  
  190.     stDocName = "Quotes Form"
  191.     DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd
  192.  
  193.  
  194. Exit_NewQuote_Click:
  195.     Exit Sub
  196.  
  197. Err_NewQuote_Click:
  198.     MsgBox Err.Description
  199.     Resume Exit_NewQuote_Click
  200.  
  201. End Sub
  202. Private Sub NewContactCmd_Click()
  203. On Error GoTo Err_NewContactCmd_Click
  204.  
  205.     Dim stDocName As String
  206.     Dim stLinkCriteria As String
  207.  
  208.     stDocName = "Contacts Form"
  209.     DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd
  210.  
  211. Exit_NewContactCmd_Click:
  212.     Exit Sub
  213.  
  214. Err_NewContactCmd_Click:
  215.     MsgBox Err.Description
  216.     Resume Exit_NewContactCmd_Click
  217.  
  218. End Sub
  219. Private Sub NewCustomerCmd_Click()
  220. On Error GoTo Err_NewCustomerCmd_Click
  221.  
  222.     Dim stDocName As String
  223.     Dim stdocname2 As String
  224.     Dim stLinkCriteria As String
  225.  
  226.     stDocName = "NewCustomer Form"
  227.     stdocname2 = "1"
  228.     DoCmd.OpenForm stDocName, , , stLinkCriteria
  229.     DoCmd.Close acForm, stdocname2, acSaveYes
  230.  
  231. Exit_NewCustomerCmd_Click:
  232.     Exit Sub
  233.  
  234. Err_NewCustomerCmd_Click:
  235.     MsgBox Err.Description
  236.     Resume Exit_NewCustomerCmd_Click
  237.  
  238. End Sub
  239. Private Sub AddContact3_Click()
  240. On Error GoTo Err_AddContact3_Click
  241.  
  242.     Dim stDocName As String
  243.     Dim stLinkCriteria As String
  244.  
  245.     stDocName = "Contacts Form"
  246.     DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd
  247.  
  248. Exit_AddContact3_Click:
  249.     Exit Sub
  250.  
  251. Err_AddContact3_Click:
  252.     MsgBox Err.Description
  253.     Resume Exit_AddContact3_Click
  254.  
  255. End Sub
  256. Private Sub NewCallReportCmd_Click()
  257. On Error GoTo Err_NewCallReportCmd_Click
  258.  
  259.     Dim stDocName As String
  260.     Dim stLinkCriteria As String
  261.  
  262.     stDocName = "CallReportForm"
  263.     DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd
  264.  
  265. Exit_NewCallReportCmd_Click:
  266.     Exit Sub
  267.  
  268. Err_NewCallReportCmd_Click:
  269.     MsgBox Err.Description
  270.     Resume Exit_NewCallReportCmd_Click
  271.  
  272. End Sub
  273.  
  274. Private Sub TimeFrameOption_AfterUpdate()
  275. Dim MySQL As String
  276. Dim MyCriteria As String
  277. MySQL = "SELECT CallReport.ID, CallReport.Numbername, CallReport.Date, CallReport.CallType, CallReport.EnteredBy, CallReport.CustomerContact, CallReport.OtherPersonnelAttending, CallReport.IssueDiscussed, CallReport.RequiresFollowUp, CallReport.FollowUpAssignedTo, CallReport.TypeOfFollowUpRequired FROM CallReport WHERE " & MyCriteria
  278.  
  279. Select Case Me!TimeFrameOption
  280. Case Is = 1
  281. MyCriteria = "[callreport].[numbername]=[custlist] and [CallReport].[Date] Between Date()-9999999999 And Date()ORDER BY CallReport.Date DESC"
  282. Case Is = 2
  283. MyCriteria = "[callreport].[numbername]=[custlist] and [CallReport].[Date] Between Date()-180 And Date()ORDER BY CallReport.Date DESC"
  284. Case Is = 3
  285. MyCriteria = "[callreport].[numbername]=[custlist] and [CallReport].[Date] Between Date()-365 And Date()ORDER BY CallReport.Date DESC"
  286. End Select
  287.  
  288. Me!CallReportList.RowSource = MySQL & MyCriteria
  289.  
  290. End Sub
  291.  
  292. Private Sub CallReportEditCmd_Click()
  293. On Error GoTo Err_CallReportEditCmd_Click
  294.  
  295.     Dim stDocName As String
  296.     Dim stLinkCriteria As String
  297.  
  298.     stDocName = "CallReportForm"
  299.  
  300.     stLinkCriteria = "[ID]=" & Me![CallReportList]
  301.     DoCmd.OpenForm stDocName, , , stLinkCriteria
  302.  
  303. Exit_CallReportEditCmd_Click:
  304.     Exit Sub
  305.  
  306. Err_CallReportEditCmd_Click:
  307.     MsgBox Err.Description
  308.     Resume Exit_CallReportEditCmd_Click
  309.  
  310. End Sub
  311. Private Sub ViewCallReportCmd_Click()
  312. On Error GoTo Err_ViewCallReportCmd_Click
  313.  
  314.     Dim stDocName As String
  315.  
  316.     stDocName = "CallReportReport"
  317.     DoCmd.OpenReport stDocName, acPreview
  318.  
  319. Exit_ViewCallReportCmd_Click:
  320.     Exit Sub
  321.  
  322. Err_ViewCallReportCmd_Click:
  323.     MsgBox Err.Description
  324.     Resume Exit_ViewCallReportCmd_Click
  325.  
  326. End Sub
May 16 '10 #9
NeoPa
32,556 Expert Mod 16PB
I find I can do no more to recover anything I'm afraid.
May 16 '10 #10
NeoPa
32,556 Expert Mod 16PB
Some more advice for working in Access. I developed this for posting guidelines, but it's sound advice for working generally too :
  1. Ensure you have Option Explicit set (See Require Variable Declaration).
  2. Try to compile it. If it doesn't compile for any reason please explain that clearly - including the error message and which line of your code it appears on. Compilation is done from the Visual Basic Editor menu - Debug \ Compile Project (Where Project is the actual name of your project).
These should help you find any problems earlier in the process. Good luck.
May 16 '10 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Matt | last post by:
Is it possible to post form data and open an invisible window? For example, in page1.as <form action="page2.asp" method="POST" It will post the form data from page1.asp to the server, and...
1
by: Amy Kalem | last post by:
On our client database, we have two main forms - Personal Information and Practice Information. We just upgraded to Office XP and now when I try to enter a new client (I first input the personal...
4
by: Corepaul | last post by:
I am working in Windows 2000 and Access 2000 and am a rookie in Access. Coding merrily along, I stop periodically to test that everything works. After adding a small amount of code to several...
5
by: John Warner | last post by:
I have a wierd problem that I can't find any reference to in the knowledge base. I develop simple databases at the company where I work, and many of them are used by hundreds of employees. We all...
4
by: Mike Turco | last post by:
A2003. I haven't seen this before. You use File/New to create a new database in Access and call it DB1. Close Access, click on db1, Access opens and there's nothing there. Then I try opening the...
1
by: Regardt | last post by:
Microsoft windows .Net 2003 I have a mayor problem! My property window won't open. I tried using the dynamic help to open the property window, but with out success. (The dynamic help window...
1
by: Regardt | last post by:
Microsoft windows .Net 2003 I have a mayor problem! My property window won't open. I tried using to dynamic help to open the property window, but with out success. (The dynamic help window won't...
19
by: =?Utf-8?B?R3JlZw==?= | last post by:
How can I tell via code if a Form is already open. Each time my forms load I have some initialization code that runs, but if the form is already open and hidden I don't want that initialization...
6
by: CAM | last post by:
Hello, I am using Visual Basic.Net 2008 I have created about 3 forms working OK in the past, but now I doesn't work anymore. When I try to start to run/debugging the program it starts to open...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.