473,508 Members | 2,283 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MS Access Database Runtime Error 2137

1 New Member
I am having an issue with an Access Database that worked at one time and after a Windows Update that screwed up the profile it stopped working. The following is what VB is stating causes the error. Any help would be greatly appreciated.
Expand|Select|Wrap|Line Numbers
  1. DoCmd.FindRecord c, acEntire, True, acSearchAll, True, acCurrent, True
  2.  
This is part of another group:
Expand|Select|Wrap|Line Numbers
  1. Private Sub name_Change()
  2. Dim c As String
  3. c = Me!name
  4. DoCmd.GoToControl "ACCOUNT"
  5. DoCmd.FindRecord c, acEntire, True, acSearchAll, True, acCurrent, True
  6. DoCmd.GoToControl "FIRST NAME"
  7. End Sub
  8.  
  9. Which is part of a whole group:
  10.  
  11. Option Compare Database
  12. Option Explicit
  13.  
  14. Private Sub ADDRESS_Exit(Cancel As Integer)
  15. Me.Refresh
  16. End Sub
  17.  
  18. Private Sub CITY_Exit(Cancel As Integer)
  19. Me.Refresh
  20. End Sub
  21.  
  22. Private Sub Combo56_Change()
  23. Dim db As Database, cr As Recordset, a
  24. Set db = CurrentDb()
  25. Me.Refresh
  26. a = Me!Combo56
  27. DoCmd.SetWarnings False
  28. DoCmd.RunSQL "SELECT [INSTRUMENT RENTAL].[INST TYPE] INTO USYSTYPE FROM [INSTRUMENT RENTAL]WHERE ((([INSTRUMENT RENTAL].[INST TYPE])=[FORMS]![INSTRUMENT RENTAL]![combo56]));"
  29. DoCmd.SetWarnings True
  30. Set cr = db.OpenRecordset("USYSTYPE", dbOpenDynaset)
  31. If Not cr.EOF Then
  32. cr.MoveLast
  33. Me![TOTALS] = a & "S RENTED = " & cr.RecordCount
  34. Else
  35. Me![TOTALS] = a & "S RENTED = 0"
  36. End If
  37. Me!TOTALS.Visible = True
  38. cr.Close
  39. End Sub
  40.  
  41. Private Sub Command36_Click()
  42. On Error GoTo Err_Command36_Click
  43.  
  44.  
  45.     DoCmd.GoToRecord , , acFirst
  46.  
  47. Exit_Command36_Click:
  48.     Exit Sub
  49.  
  50. Err_Command36_Click:
  51.     MsgBox Err.Description
  52.     Resume Exit_Command36_Click
  53.  
  54. End Sub
  55. Private Sub Command37_Click()
  56. On Error GoTo Err_Command37_Click
  57.  
  58.  
  59.     DoCmd.GoToRecord , , acLast
  60.  
  61. Exit_Command37_Click:
  62.     Exit Sub
  63.  
  64. Err_Command37_Click:
  65.     MsgBox Err.Description
  66.     Resume Exit_Command37_Click
  67.  
  68. End Sub
  69. Private Sub Command38_Click()
  70. On Error GoTo Err_Command38_Click
  71.  
  72.  
  73.     DoCmd.GoToRecord , , acNext
  74.  
  75. Exit_Command38_Click:
  76.     Exit Sub
  77.  
  78. Err_Command38_Click:
  79.     MsgBox Err.Description
  80.     Resume Exit_Command38_Click
  81.  
  82. End Sub
  83. Private Sub Command39_Click()
  84. On Error GoTo Err_Command39_Click
  85.  
  86.  
  87.     DoCmd.GoToRecord , , acPrevious
  88.  
  89. Exit_Command39_Click:
  90.     Exit Sub
  91.  
  92. Err_Command39_Click:
  93.     MsgBox Err.Description
  94.     Resume Exit_Command39_Click
  95.  
  96. End Sub
  97. Private Sub Command40_Click()
  98. On Error GoTo Err_Command40_Click
  99.  
  100.  
  101.     Screen.PreviousControl.SetFocus
  102.     DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
  103.  
  104. Exit_Command40_Click:
  105.     Exit Sub
  106.  
  107. Err_Command40_Click:
  108.     MsgBox Err.Description
  109.     Resume Exit_Command40_Click
  110.  
  111. End Sub
  112. Private Sub Command41_Click()
  113. On Error GoTo Err_Command41_Click
  114.  
  115.  
  116.     DoCmd.GoToRecord , , acNewRec
  117.  
  118. Exit_Command41_Click:
  119.     Exit Sub
  120.  
  121. Err_Command41_Click:
  122.     MsgBox Err.Description
  123.     Resume Exit_Command41_Click
  124.    DoCmd.GoToControl "FIRST NAME"
  125. End Sub
  126. Private Sub Command42_Click()
  127. On Error GoTo Err_Command42_Click
  128.  
  129.  
  130.     DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
  131.     DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
  132.  
  133. Exit_Command42_Click:
  134.     Exit Sub
  135.  
  136. Err_Command42_Click:
  137.     MsgBox Err.Description
  138.     Resume Exit_Command42_Click
  139.  
  140. End Sub
  141. Private Sub Command43_Click()
  142. On Error GoTo Err_Command43_Click
  143.  
  144.  
  145.     DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
  146.  
  147. Exit_Command43_Click:
  148.     Exit Sub
  149.  
  150. Err_Command43_Click:
  151.     MsgBox Err.Description
  152.     Resume Exit_Command43_Click
  153.  
  154. End Sub
  155. Private Sub Command44_Click()
  156. On Error GoTo Err_Command44_Click
  157.  
  158.  
  159.     DoCmd.Close
  160.  
  161. Exit_Command44_Click:
  162.     Exit Sub
  163.  
  164. Err_Command44_Click:
  165.     MsgBox Err.Description
  166.     Resume Exit_Command44_Click
  167.  
  168. End Sub
  169.  
  170. Private Sub Command46_Click()
  171. Dim c As String
  172. Me.Refresh
  173. c = MsgBox("ARE YOU SURE YOU WANT TO PRINT ALL THE INVOICES?", vbYesNo + vbQuestion + vbDefaultButton2, "PRINT INVOICES")
  174. If c = 6 Then
  175. DoCmd.OpenReport "InstRenInv1", acViewPreview
  176. DoCmd.OpenReport "InstRenInv2", acViewPreview
  177. End If
  178. End Sub
  179.  
  180. Private Sub Command47_Click()
  181. Me.Refresh
  182. DoCmd.OpenReport "InstRenSinInv", acViewPreview
  183. End Sub
  184.  
  185. Private Sub Command51_Click()
  186. DoCmd.Quit acQuitPrompt
  187. End Sub
  188.  
  189. Private Sub Command52_Click()
  190. Dim db As Database, cr As Recordset, a
  191. Set db = CurrentDb()
  192. Me!TOTALS.Visible = False
  193. a = InputBox$("ENTER THE TYPE OF INSTRUMENT!", "INSTRUMENT TYPE")
  194. If a = "" Then
  195. GoTo FIN
  196. End If
  197. Me!HID = a
  198. DoCmd.SetWarnings False
  199. DoCmd.RunSQL "SELECT [INSTRUMENT RENTAL].[INST TYPE] INTO USYSTYPE FROM [INSTRUMENT RENTAL]WHERE ((([INSTRUMENT RENTAL].[INST TYPE])=[FORMS]![INSTRUMENT RENTAL]![HID]));"
  200. DoCmd.SetWarnings True
  201. Set cr = db.OpenRecordset("USYSTYPE", dbOpenDynaset)
  202. If Not cr.EOF Then
  203. cr.MoveLast
  204. Me![TOTALS] = a & "S RENTED = " & cr.RecordCount
  205. Else
  206. Me![TOTALS] = a & "S RENTED = 0"
  207. End If
  208. Me!TOTALS.Visible = True
  209. cr.Close
  210. GoTo FIN1
  211. FIN:
  212. MsgBox "YOU DID NOT ENTER AN INSTRUMENT TYPE!"
  213. FIN1:
  214. End Sub
  215.  
  216. Private Sub Command58_Click()
  217. DoCmd.OpenReport "InstTable", acViewPreview
  218. End Sub
  219.  
  220. Private Sub Command59_Click()
  221. DoCmd.OpenReport "PastDue", acViewPreview
  222. End Sub
  223.  
  224. Private Sub FIRST_NAME_Exit(Cancel As Integer)
  225. Me.Refresh
  226. End Sub
  227.  
  228. Private Sub Form_Activate()
  229. DoCmd.Maximize
  230. End Sub
  231.  
  232. Private Sub Form_Load()
  233. Dim db As Database, cr As Recordset, a As Integer
  234. Set db = CurrentDb()
  235. Set cr = db.OpenRecordset("SELECT [INSTRUMENT RENTAL].[FIRST NAME], [INSTRUMENT RENTAL].[LAST NAME], [INSTRUMENT RENTAL].ADDRESS, [INSTRUMENT RENTAL].[MAILING ADDRESS], [INSTRUMENT RENTAL].CITY, [INSTRUMENT RENTAL].STATE, [INSTRUMENT RENTAL].ZIP, [INSTRUMENT RENTAL].[HOME PHONE], [INSTRUMENT RENTAL].[WORK PHONE], [INSTRUMENT RENTAL].[INST TYPE], [INSTRUMENT RENTAL].[INST MFR], [INSTRUMENT RENTAL].[SERIAL NO], [INSTRUMENT RENTAL].[PURCHASE PRICE], [INSTRUMENT RENTAL].[PURCHASE BALANCE], [INSTRUMENT RENTAL].[RENTAL FEE], [INSTRUMENT RENTAL].[LATE FEE], [INSTRUMENT RENTAL].[OVERDUE PMT], [INSTRUMENT RENTAL].ACCOUNT FROM [INSTRUMENT RENTAL]WHERE ((([INSTRUMENT RENTAL].[OVERDUE PMT])>0));", dbOpenDynaset)
  236. If Not cr.EOF Then
  237. cr.MoveLast
  238. a = cr.RecordCount
  239. MsgBox "THERE ARE " & "(" & a & ")" & " CUSTOMERS WHO HAVE PAST DUE BALANCES! PRESS THE PAST DUE BALANCES OPTION BUTTON TO VIEW THEM!"
  240. End If
  241. End Sub
  242.  
  243. Private Sub INST_TYPE_Exit(Cancel As Integer)
  244. Me.Refresh
  245. End Sub
  246.  
  247. Private Sub LAST_NAME_Exit(Cancel As Integer)
  248. Me.Refresh
  249. End Sub
  250.  
  251. Private Sub MAILING_ADDRESS_Exit(Cancel As Integer)
  252. Me.Refresh
  253. End Sub
  254.  
  255. Private Sub name_Change()
  256. Dim c As String
  257. c = Me!name
  258. DoCmd.GoToControl "ACCOUNT"
  259. DoCmd.FindRecord c, acEntire, True, acSearchAll, True, acCurrent, True
  260. DoCmd.GoToControl "FIRST NAME"
  261. End Sub
  262.  
  263. Private Sub Option60_Click()
  264. Dim db As Database, cr As Recordset, a As Integer
  265. Set db = CurrentDb()
  266. Set cr = db.OpenRecordset("SELECT [INSTRUMENT RENTAL].[FIRST NAME], [INSTRUMENT RENTAL].[LAST NAME], [INSTRUMENT RENTAL].ADDRESS, [INSTRUMENT RENTAL].[MAILING ADDRESS], [INSTRUMENT RENTAL].CITY, [INSTRUMENT RENTAL].STATE, [INSTRUMENT RENTAL].ZIP, [INSTRUMENT RENTAL].[HOME PHONE], [INSTRUMENT RENTAL].[WORK PHONE], [INSTRUMENT RENTAL].[INST TYPE], [INSTRUMENT RENTAL].[INST MFR], [INSTRUMENT RENTAL].[SERIAL NO], [INSTRUMENT RENTAL].[PURCHASE PRICE], [INSTRUMENT RENTAL].[PURCHASE BALANCE], [INSTRUMENT RENTAL].[RENTAL FEE], [INSTRUMENT RENTAL].[LATE FEE], [INSTRUMENT RENTAL].[OVERDUE PMT], [INSTRUMENT RENTAL].ACCOUNT FROM [INSTRUMENT RENTAL]WHERE ((([INSTRUMENT RENTAL].[OVERDUE PMT])>0));", dbOpenDynaset)
  267. Me.RecordSource = "SELECT [INSTRUMENT RENTAL].[FIRST NAME], [INSTRUMENT RENTAL].[LAST NAME], [INSTRUMENT RENTAL].ADDRESS, [INSTRUMENT RENTAL].[MAILING ADDRESS], [INSTRUMENT RENTAL].CITY, [INSTRUMENT RENTAL].STATE, [INSTRUMENT RENTAL].ZIP, [INSTRUMENT RENTAL].[HOME PHONE], [INSTRUMENT RENTAL].[WORK PHONE], [INSTRUMENT RENTAL].[INST TYPE], [INSTRUMENT RENTAL].[INST MFR], [INSTRUMENT RENTAL].[SERIAL NO], [INSTRUMENT RENTAL].[PURCHASE PRICE], [INSTRUMENT RENTAL].[PURCHASE BALANCE], [INSTRUMENT RENTAL].[RENTAL FEE], [INSTRUMENT RENTAL].[LATE FEE], [INSTRUMENT RENTAL].[OVERDUE PMT], [INSTRUMENT RENTAL].ACCOUNT FROM [INSTRUMENT RENTAL]WHERE ((([INSTRUMENT RENTAL].[OVERDUE PMT])>0));"
  268. Forms![INSTRUMENT RENTAL]![name].RowSource = "SELECT [INSTRUMENT RENTAL].ACCOUNT,[INSTRUMENT RENTAL].[LAST NAME], [INSTRUMENT RENTAL].[FIRST NAME], [INSTRUMENT RENTAL].ADDRESS, [INSTRUMENT RENTAL].[HOME PHONE]FROM [INSTRUMENT RENTAL]WHERE ((([INSTRUMENT RENTAL].[OVERDUE PMT]) > 0))ORDER BY [INSTRUMENT RENTAL].[LAST NAME];"
  269. Me.Requery
  270. If Not cr.EOF Then
  271. cr.MoveLast
  272. a = cr.RecordCount
  273. MsgBox "THE FOLLOWING " & "(" & a & ")" & " CUSTOMERS HAVE PAST DUE BALANCES!"
  274. Forms![INSTRUMENT RENTAL]![PAST DUE BALANCE].ForeColor = 255
  275. Else
  276. Me.RecordSource = "SELECT [INSTRUMENT RENTAL].* FROM [INSTRUMENT RENTAL]ORDER BY [INSTRUMENT RENTAL].[LAST NAME];"
  277. Forms![INSTRUMENT RENTAL]![name].RowSource = "SELECT [INSTRUMENT RENTAL].ACCOUNT,[INSTRUMENT RENTAL].[LAST NAME], [INSTRUMENT RENTAL].[FIRST NAME], [INSTRUMENT RENTAL].ADDRESS, [INSTRUMENT RENTAL].[HOME PHONE] FROM [INSTRUMENT RENTAL] ORDER BY [INSTRUMENT RENTAL].[LAST NAME];"
  278. Forms![INSTRUMENT RENTAL]![PAST DUE BALANCE].ForeColor = 0
  279. Me.Requery
  280. MsgBox "THE ARE NO CUSTOMERS WHO HAVE PAST DUE BALANCES!"
  281. End If
  282. End Sub
  283.  
  284. Private Sub Option65_Click()
  285. Me.RecordSource = "SELECT [INSTRUMENT RENTAL].* FROM [INSTRUMENT RENTAL]ORDER BY [INSTRUMENT RENTAL].[LAST NAME];"
  286. Forms![INSTRUMENT RENTAL]![name].RowSource = "SELECT [INSTRUMENT RENTAL].ACCOUNT,[INSTRUMENT RENTAL].[LAST NAME], [INSTRUMENT RENTAL].[FIRST NAME], [INSTRUMENT RENTAL].ADDRESS, [INSTRUMENT RENTAL].[HOME PHONE] FROM [INSTRUMENT RENTAL] ORDER BY [INSTRUMENT RENTAL].[LAST NAME];"
  287. Forms![INSTRUMENT RENTAL]![PAST DUE BALANCE].ForeColor = 0
  288. Me.Requery
  289. End Sub
  290.  
  291. Private Sub STATE_Exit(Cancel As Integer)
  292. Me.Refresh
  293. End Sub
  294.  
  295. Private Sub ZIP_Exit(Cancel As Integer)
  296. Me.Refresh
  297. End Sub
Dec 24 '09 #1
1 3033
debasisdas
8,127 Recognized Expert Expert
Kindly mention which block of code is causing the error.also mention the error number and error message.
Dec 24 '09 #2

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

Similar topics

12
18648
by: Phil Powell | last post by:
<cfquery name="getAll" datasource="#request.dsn#"> SELECT U.userID, U.fname, U.lname, U.phone, U.lastLoggedIn, U.choiceId, U.experience, T.label AS teamLabel, R.label AS roleLabel FROM User U...
5
15102
by: Nathan Bloom | last post by:
Hi, I have a secured database that runs fine on the computer the database is installed on. I have several workstations with access runtime installed that also need access to the database. ...
49
14282
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The...
7
8822
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
11
6551
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
4
4372
by: Aliza Klein | last post by:
Apologies in advance as I am SURE this has been asked 100 times - but I haven't got a simple answer: I have MS Office XP Developer and have created an installation package (with the runtime) for...
6
539
by: mark | last post by:
I have an asp.net ecommerce web application on a remote web server. I'm using an Access database on the back end. I've notice a few strange things. When I mimic an multiple user environment by...
11
4574
by: DraguVaso | last post by:
Hi, I want to make a small application in VB.NET that relinks all the query's and tables in an Access database that are linked via ODBC to an SQL Server. It must be able to relink all the tables...
0
2153
by: Yelena Varshal via AccessMonster.com | last post by:
Hello We have a shortcut for our MS ACCESS application that uses a /Runtime switch because we may have some users that use Runtime. The application worked fine in Access 2000 and was tested with...
0
7224
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7120
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
7323
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,...
1
5050
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4706
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1553
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
415
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.