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

Issue with RecordsetClone and updating in Access 2003

I am working on a DB that 5 users input data coming in daily. The data is simple and is filled out in a form and submitted. If a user needs to reference a previously entered record (found by a reference number automatically generated for each call). I copied and pasted code early on in this project to accomplish the task of bringing up a record:

Expand|Select|Wrap|Line Numbers
  1. Dim rs As DAO.Recordset
  2.  
  3.     If Not IsNull(Me.cboMoveTo) Then
  4.         'Save before move.
  5.         If Me.Dirty Then
  6.             Me.Dirty = False
  7.         End If
  8.         'Search in the clone set.
  9.         Set rs = Me.RecordsetClone
  10.         rs.FindFirst "[Reference #] = " & Me.cboMoveTo
  11.         If rs.NoMatch Then
  12.             MsgBox "Reference # not found. Please re-enter."
  13.         Else
  14.                     'Display the found record in the form.
  15.             Me.Bookmark = rs.Bookmark
  16.  
  17.             Forms!Master!Frame147.Value = 4
  18.             Forms!Master!txtHidden.Value = "Locked"
  19.             Me.Text229 = ""
  20.             DoCmd.RunCommand acCmdSaveRecord
  21.         End If
  22.         End If
  23.  
  24.  
  25.         Set rs = Nothing
I added a few things I wanted to happen in there but here is my problem.

If one user is creating new records and say another user goes on break and comes back 20 minutes later and tries to call up one of the records that the user inputed, it comes up with "Reference # not found. Please re-enter.", which is the message I have for if the reference number is not found.

EVERYTHING about this code works excellent except this one small hickup! The only way I've found to solve it is to completely exit that form and reopen it, so it has to be some type of update issue.

I've tried:

Expand|Select|Wrap|Line Numbers
  1. DoCmd.RunCommand acCmdSaveRecord
I've also tried refresh and repaint code in the form and click events???

Nothing other than completely exiting and reopening has worked!

Any ideas???
Mar 31 '10 #1
3 3034
ADezii
8,834 Expert 8TB
Try adding Line #9 and see what happens.
Expand|Select|Wrap|Line Numbers
  1. Dim rs As DAO.Recordset
  2.  
  3. If Not IsNull(Me.cboMoveTo) Then
  4.   'Save before move.
  5.   If Me.Dirty Then
  6.     Me.Dirty = False
  7.   End If
  8.  
  9.   Me.Recordset.Requery           'ADD
  10.  
  11.   'Search in the clone set.
  12.   Set rs = Me.RecordsetClone
  13.   rs.FindFirst "[Reference #] = " & Me.cboMoveTo
  14.     If rs.NoMatch Then
  15.       MsgBox "Reference # not found. Please re-enter."
  16.     Else
  17.       'Display the found record in the form.
  18.       Me.Bookmark = rs.Bookmark
  19.  
  20.       Forms!Master!Frame147.Value = 4
  21.       Forms!Master!txtHidden.Value = "Locked"
  22.       Me.Text229 = ""
  23.       DoCmd.RunCommand acCmdSaveRecord
  24.     End If
  25. End If
  26.  
  27. Set rs = Nothing
Mar 31 '10 #2
Adezii,

Thanks for the reply! I will insert that immediately and let you know!

Thanks again!
Mar 31 '10 #3
Adezii,

It definitely took care of that issue, but something else has come up as a result that doesn't happen all the time.

What happens, when it happens is that if you type in a reference number, it will bring up a different reference number (seems to be random) and an error comes up:

Run-Time error '3077':
Syntax error (missing operator) in expression

If I click on "Debug", it highlights the following line/code:
Expand|Select|Wrap|Line Numbers
  1. rs.FindFirst "[Reference #] = " & Me.cboMoveTo
If you go back and re-click enter with the same ref number, it will work perfect that time (the 2nd time).

Being that it doesn't happen all the time and it always works if you do it twice (after clicking "End" on the error popup) it sounds like a timing and/or multiple user issue???

Any ideas?
Apr 14 '10 #4

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

Similar topics

17
by: Danny J. Lesandrini | last post by:
The following code works with a standard MDB to navigate to a particluar record (with a DAO recordset, of course) but it's giving me problems in an ADP I'm working on. Dim rs As ADODB.Recordset...
13
by: Seth Spearman | last post by:
Hey guys, I have the following code: '****************************************************** If Not Me.NewRecord Then Dim rs As DAO.Recordset Dim strBookmark As String Set rs =...
3
by: Ian Bailey | last post by:
I have developed a routine that opens a number of forms with each form being positioned on a particular record. I am using the Recordsetclone to find the record and then setting the form bookmark...
3
by: GGerard | last post by:
Hello I am trying to refer in code to the RecordsetClone of a subform datasheet but I'm getting syntax errors. This is what I am writing: Set MyDB = DBEngine.Workspaces(0).Databases(0)...
1
by: Rémi | last post by:
Hello! I have a very general question for old Access hands. I am familiar with a form's Recordset and RecordsetClone properties. In what cases do you choose to use one over the other? Are there...
2
by: Doc | last post by:
Per earlier post, I am trying to save 'out' production data from a program called Solomon - basically (I think) this was /is an Access/Sql based program. We are updating to different application...
2
by: Alexey.Murin | last post by:
The application we are developing uses MS Access 2003 database (with help of ADO). We have noticed that during massive records updating the size of the mdb file increases dramatically (from 3-4 to...
10
by: d.francis | last post by:
I have converted an Access 97 database to Access 2003 The following code now fails and returns Run-time error '3420' Dim rst as DAO.recordset Set rst = Forms!frm1!frm2.Form.RecordsetClone I...
2
by: Certys | last post by:
Hello, I have a form where I only allow new records to be added. I enable this by setting the form property "Data Entry" to Yes. I want to access other records in the same table- to autofill...
3
by: supergirlgem | last post by:
Hi, I have just been on an access course and was given the following code: Dim rs As DAO.Recordset Set rs = Forms!frmFilm.Form.RecordsetClone Call rs.FindFirst("FilmID =" & Me.lstFilm.Value)...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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?
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
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
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
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...

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.