473,387 Members | 1,700 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,387 software developers and data experts.

Form wont read query

I have a database that works (worked until this morning) great. I have it running off of Access 2003. What's happening is that my form named Investigation isn't showing any records when I open it manually. I have a frmMaster that opens it in add mode, but when I open the form from the menu screen it still shows no records. I checked my tables and they are fine, I checked the query it runs off of and it opens with all the records. The only thing I can think of is I added a new module that disables the mouse movement, but I don't think that would have anything to do with it. Here is the code for that module.

Expand|Select|Wrap|Line Numbers
  1.  Option Compare Database
  2.  
  3. Option Explicit
  4. Private Declare Function LoadLibrary Lib "kernel32" _
  5. Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
  6. Private Declare Function FreeLibrary Lib "kernel32" _
  7. (ByVal hLibModule As Long) As Long
  8. Private Declare Function StopMouseWheel Lib "MouseHook" _
  9. (ByVal hWnd As Long, ByVal AccessThreadID As Long, Optional ByVal blIsGlobal As Boolean = False) As Boolean
  10. Private Declare Function StartMouseWheel Lib "MouseHook" _
  11. (ByVal hWnd As Long) As Boolean
  12. Private Declare Function GetCurrentThreadId Lib "kernel32" () As Long
  13. ' Instance returned from LoadLibrary call
  14. Private hLib As Long
  15. Public Function MouseWheelON() As Boolean
  16. MouseWheelON = StartMouseWheel(Application.hWndAccessApp)
  17. If hLib <> 0 Then
  18.     hLib = FreeLibrary(hLib)
  19. End If
  20. End Function
  21. Public Function MouseWheelOFF(Optional GlobalHook As Boolean = False) As Boolean
  22. Dim s As String
  23. Dim blRet As Boolean
  24. Dim AccessThreadID As Long
  25. On Error Resume Next
  26. ' Our error string
  27. s = "Sorry...cannot find the MouseHook.dll file" & vbCrLf
  28. s = s & "Please copy the MouseHook.dll file to your Windows System folder or into the same folder as this Access MDB."
  29. ' OK Try to load the DLL assuming it is in the Window System folder
  30. hLib = LoadLibrary("MouseHook.dll")
  31. If hLib = 0 Then
  32.     ' See if the DLL is in the same folder as this MDB
  33.     ' CurrentDB works with both A97 and A2K or higher
  34.     hLib = LoadLibrary(CurrentProject.Path & "\MouseHook.dll")
  35.     If hLib = 0 Then
  36.         MsgBox s, vbOKOnly, "MISSING MOUSEHOOK.dll FILE"
  37.         MouseWheelOFF = False
  38.         Exit Function
  39.     End If
  40. End If
  41. ' Get the ID for this thread
  42. AccessThreadID = GetCurrentThreadId()
  43. ' Call our MouseHook function in the MouseHook dll.
  44. ' Please not the Optional GlobalHook BOOLEAN parameter
  45. ' Several developers asked for the MouseHook to be able to work with
  46. ' multiple instances of Access. In order to accomodate this request I
  47. ' have modified the function to allow the caller to
  48. ' specify a thread specific(this current instance of Access only) or
  49. ' a global(all applications) MouseWheel Hook.
  50. ' Only use the GlobalHook if you will be running multiple instances of Access!
  51. MouseWheelOFF = StopMouseWheel(Application.hWndAccessApp, AccessThreadID, GlobalHook)
  52. End Function
  53. '******************** Code Begin ****************
  54. 'Code courtesy of
  55. 'Terry Kreft & Ken Getz
  56. '
  57. Function CurrentDBDir() As String
  58. Dim strDBPath As String
  59. Dim strDBFile As String
  60.     strDBPath = CurrentDb.Name
  61.     strDBFile = Dir(strDBPath)
  62.     CurrentDBDir = Left$(strDBPath, Len(strDBPath) - Len(strDBFile))
  63. End Function
  64. '******************** Code End **************** 
Jun 7 '10 #1

✓ answered by RuralGuy

Any chance you might have set the DataEntry property to True? That will only let you see *new* records.

3 1659
RuralGuy
375 Expert 256MB
Any chance you might have set the DataEntry property to True? That will only let you see *new* records.
Jun 7 '10 #2
LOL Wow, I could have sworn I checked that and I re-checked and that's all it was! Thank you so much! :)
Jun 7 '10 #3
RuralGuy
375 Expert 256MB
Glad we could help.
Jun 8 '10 #4

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

Similar topics

1
by: Shaun | last post by:
Hi all Ok here is the big question, have a form that was bound to a now large database (Access 2002 client / server split) and I was accessing various records based on using applyfilter. Now to me...
2
by: Robert | last post by:
I am trying to give the user dynamic search capabilities to select almost any record in the database from criteria they select. Everything seems to work except when I open the display form to...
4
by: john | last post by:
I created a form via the wizard with 1 main table and 2 one-on-one tables. As i couldn't add a field to the form (a field that I added to the table after creating the form), I googled out that the...
4
by: reidarT | last post by:
I have a dataset with 2 tables. I have madee a query of theese 2 tables. When I look at the datasources the query is not shown. How do I make a form with the query as source? reidarT
10
by: sesling | last post by:
I have created a query that will pull information from our database for the operators. This query will pull in on average 50,000 records. The operators need to refine the search results. I have...
1
by: jmarr02s | last post by:
When I double click on my form..I get a Parameter Query box. How can I turn this off?! I went to properties, but did not see anything that would help remove this. I also deleted the query...
1
by: starke1120 | last post by:
Is there a way to open a form based on query type.. Example.. If a certain query result is 1 then open the form to this result.. If the query results are NULL or 0 results, then open open for...
8
by: Mark12345 | last post by:
Hi folks, thanks for looking. I have a database that takes down order details. Each customer has there own priceid in the price table. the errors that I get say enter parameter value for:...
0
by: Bob | last post by:
I hope somebody can help. I'm linking to an excel spreadsheet with several fields that come across as double. I can query the linked table fine, but when I make a form with the query as the...
2
by: CharlieUK | last post by:
I have a button on a Client form that opens a form with a query as filter. If the query filters no records then the form comes up blank and doesnt even show the close button. Im trying to use code to...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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,...

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.