473,396 Members | 2,039 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,396 software developers and data experts.

How to handle form when it reaches EOF

22
Hi,

Thanks buddies for all ur help for the threads that i posted earlier!!
Again i have some questions..

The form that i created is one that shows records that are not in a particular table , once its updated to the table through a submit button on the form, it does not appear on the form (meaning, the form shows only ones that are still not been processed,)
so finaaly when it reaches the end of file, the form becomes blank and "ACCESS says it had encountered an error and needs to close" and creates backup copy..i dont want this to happen when the users use it.
I tried giving a recordset.Eof condition , when true giving a message to the user that "all have been done", but as soon as it jumps into that if block when it reaches EOF condition Access Pops up that message, How to solve this???

Thanks very much in advance!!!
May 4 '07 #1
6 2190
MMcCarthy
14,534 Expert Mod 8TB
Hi,

Thanks buddies for all ur help for the threads that i posted earlier!!
Again i have some questions..

The form that i created is one that shows records that are not in a particular table , once its updated to the table through a submit button on the form, it does not appear on the form (meaning, the form shows only ones that are still not been processed,)
so finaaly when it reaches the end of file, the form becomes blank and "ACCESS says it had encountered an error and needs to close" and creates backup copy..i dont want this to happen when the users use it.
I tried giving a recordset.Eof condition , when true giving a message to the user that "all have been done", but as soon as it jumps into that if block when it reaches EOF condition Access Pops up that message, How to solve this???

Thanks very much in advance!!!
It's difficult to comment without seeing the relevant code. Have you left the form unbound or is there something in the record source of the form?
May 4 '07 #2
jaishu
22
Yes , the form is loaded(refreshed) everytime an id is assigned, requeried, so the code is ..Once i assign a particular ID(if insert into backend table is successful), then i requery the form as i dopnt want the assigned IDs to reappear in the form, , The form is based on query, so after succesful insertion i give the code

[code goes here].......
MsgBox "ASSIGN SUCCESSFUL"
Form_mainformname.Requery
Form_subformname_sub.Requery
Form_mainformname.Text34 = Clear
Form_mainformname.Text34.SetFocus ----------------This is where i get the problem when EOF is reached , It pops up with the message saying, "You Cant got to the specified record", bcos there is no more records, now how to overcome this?

Hope this makes you understand my problem.!
May 4 '07 #3
jaishu
22
First of all , the Business users will have this as an Access application to assign an ID to each member. What we do from IT perspective is get data files,do preprocessing and suggest matches for each member say for Member A ,we wud have suggested ID1, ID 4, ID 3, and for MEmber B , wud have 4 suggested matches ID1,ID2,ID4, ID5 and only the business users know what is the correct match for each member A , B and so on, so they have this front end application as a form, which takes data from all tables(Oracle tables that we load based on our Procedures..) so that they choose the best match of all choices.


So the form displays Member related Data, and all the suggested choices in a subform, where Business user picks one and puts it in a text box provided and Hits Submit, That ID is assigned to that particular member and written to output table from where We do processing again .There are more than 10000 members ..The form does all this...its based on a query which says select member from input table where member not in output table

Now if user completes assigning ID for all 10000 members , there is no record to pick from input table as the query is not satisfied, so Form becomes blank (because once a member is assigned an ID , it goes to output table,)
Hope i have explained clearly, i am also attaching the code.


Expand|Select|Wrap|Line Numbers
  1. Private Sub submitid_Click()
  2.  
  3. dim rs as new adodb.recordset
  4.  
  5. If MsgBox("Are you sure you want to assign " & UCase(Text34) & " to " & MEMBER_ID & " ", vbYesNo, "Confirm selection") = vbYes Then
  6.  
  7. query2 = "select match_id, member_id,match_id_type from output table where match_id = '" & UCase(Text34) & "' or member_id ='" & MEMBER_ID & "'"
  8. rs.Open query2, Cnt, adOpenKeyset, adLockOptimistic
  9.  
  10. If rs.RecordCount = -1 Or rs.RecordCount = 0 Then  
  11.  
  12. query1 = "Insert into output table (member_id,match_id,match_id_type, match_level,last_modified ) " & _
  13. "select member_id,match_id,match_id_type, match_level,'" & dtm & "' from" & _"
  14. " input table where member_id ='" & MEMBER_ID & "' and match_id = '" & UCase(Text34) & "' and " & _
  15.                    " match_id_type ='" & rsmatchy("match_id_type") & "' and match_level = " & rsmatchy("match_level") & " ; "
  16.  
  17. DoCmd.SetWarnings False
  18. DoCmd.RunSQL query1
  19. MsgBox "ASSIGN SUCCESSFUL"                      
  20.  
  21. queryref = " SELECT MEMBER_ID, MEMBER_NAME,                          MEMBER_END_DATE, FROM Input table WHERE                             input table.MEMBER_ID NOT IN ( SELECT output table.MEMBER_ID FROM output table)"                         
  22. Form_mainform.Requery
  23. Form_sub.Requery
  24. Me.Text34.SetFocus
  25. Text34 = Clear
  26. Exit sub
  27. Else
  28.  
  29. MsgBox " " & rs("MATCH_ID_TYPE") & " ID " & rs("MATCH_ID") & " has already been assigned to member " & rs("member_id") & "  ", vbCritical, "MatchID Conflict"
  30. Text34 = Clear
  31. Me.Text34.SetFocus
  32. Exit Sub
  33. End if
  34.  

THE form is based on Queryref, a query based on which the form loads and then on its requeried everytime after insert, now when all 10000 records are done , when this is requeried, it returns nothing and form becomes blank, and says "you cant got to the specified record " when it comes to me.text34.setfocus... This is what is my problem..What is the sol?
May 9 '07 #4
NeoPa
32,556 Expert Mod 16PB
Hi,

Thanks buddies for all ur help for the threads that i posted earlier!!
Again i have some questions..

The form that i created is one that shows records that are not in a particular table , once its updated to the table through a submit button on the form, it does not appear on the form (meaning, the form shows only ones that are still not been processed,)
so finaaly when it reaches the end of file, the form becomes blank and "ACCESS says it had encountered an error and needs to close" and creates backup copy..i dont want this to happen when the users use it.
I tried giving a recordset.Eof condition , when true giving a message to the user that "all have been done", but as soon as it jumps into that if block when it reaches EOF condition Access Pops up that message, How to solve this???

Thanks very much in advance!!!
You say (as I suspected) in one of your other posts, that this happens after a .Requery. In that case I suggest that you may like to do DCount() (or such like) check on the recordset immediately beforehand. If it shows that there are no records available, simply close the form instead of requerying.

I hope this helps you.
May 10 '07 #5
jaishu
22
Thanks very much! Its working now,
I tried doing a check before requerying but i didnt close the form and Just gave a message , so i had all these errors.....
Now its Fine!Thanks a lot!
May 10 '07 #6
NeoPa
32,556 Expert Mod 16PB
Thanks very much! Its working now,
I tried doing a check before requerying but i didnt close the form and Just gave a message , so i had all these errors.....
Now its Fine!Thanks a lot!
I'm very pleased to hear it.
We're here if you have any more questions :)
May 10 '07 #7

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

Similar topics

4
by: Brad Jones | last post by:
<Previously posted in microsoft.public.dotnet.framework.windowsforms> Hi all. Any suggestions here would be appreciated. Thanks for reading. I'm primarly a C++ developer but I've been trying to...
11
by: objectref | last post by:
Hi to all, is there a way to get the window handle of the main window of an application or process ? For example, if someone opens Microsoft Word, he gets a window so he/she can write text....
4
by: Nacho Nachev | last post by:
This may sound like a silly question, but what is the appropriate way to handle form double submitting in ASP.NET. Page expiration, etc? I am looking for a way to handle this in some cetral point...
15
by: Adam J. Schaff | last post by:
I have noticed that if a user closes a form via pressing return (either while the OK button has focus or if AcceptButton is set to OK for the form) then the "ENTER" keypress event fires ON THE...
39
by: tydbowl | last post by:
I have a problem where the below code chunk causes handle leaks on some machines. The leak APPEARS to be handles to the registry key: HKCU\Software\Microsoft\Windows\CurrentVersion\Internet...
5
by: raulavi | last post by:
vb VS 2003 Hi all: thanks to all in advance for your responses. my app displays the form , then when it reaches a debbuging point the form is blanked, (it just shows the frame around the form) I...
2
by: Ian | last post by:
Hi, Is anybody aware of problems in .NET where the handle count of an application increases over time? We have a server application that is hosted in a Windows Service and accepts socket...
0
by: Marc Bartsch | last post by:
Hi, I have a WinForms application (C#, VS 2005) that consists of a treeview control and a notify icon. Below is a complete example of this application. The treeview has one root node and one child...
7
by: Piotrekk | last post by:
Hi I am using INCA RTX library which i've added to my project resources. Then i created an object i need to release it manually. I have found example in MSND - how to release com object...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.