473,474 Members | 1,571 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Duplicated Records in Unbound Textboxes

10 New Member
Hello everyone,

Attached is a sample of my project to help you see the issue yourself instead of me trying to explain. It's kind of confusing.

Once you open the db. open up the frmQuoteLog and the frmPDMontior. You will notice one record is displayed in the frmPDMonitor (Justin Ryan). This is correct.

Now to test out the issue leave open the frmPDMonitor and frmQuoteLog at the same time. Go to frmQuotLog, go to the first record, make the "Sales Coordinator" = "Chris April", then check the box that says "Display on Product Design Monitor", then press the "Save Changes" button.

Then look at the frmPDMonitor and you will notice the new record is now displayed on the form. This is correct as well.

Leaving open both forms, go to frmQuoteLog and uncheck the box you previous checked on the first record, then press "Save Changes".

Then look again at the frmPDMontior and notice that the previous record is gone but the remaining record is now duplicated.

Only when I close the frmPDMonitor and reopen it, does the duplication go away.

How can I avoid this duplication without closing and reopening the frmPDMonitor? The purpose of this form is to be ran 24/7.

Sorry for the long explanation but I wanted to make sure I explained everything for the best possible solution.

Completing this project is a top priority for me and could really use some the help.

As always thank you,

-Justin
Attached Files
File Type: zip SampleQuoteLog(5-7-14).zip (257.3 KB, 53 views)
May 7 '14 #1
6 1229
Rabbit
12,516 Recognized Expert Moderator MVP
As a rule of thumb, I do not download attachments from people I don't know. Instead, please post the relevant code.
May 7 '14 #2
Justair07
10 New Member
Here is the code used in a standard module in access.

Expand|Select|Wrap|Line Numbers
  1. Public Sub LoadMyForm(frm As Access.Form)
  2. On Error GoTo Error_Handler
  3. '    Dim db              As DAO.Database
  4.     Dim rs              As DAO.Recordset
  5.     Dim x               As Integer
  6.  
  7. '    Set db = CurrentDb()
  8.     Set rs = db.OpenRecordset("qryPDMonitor", dbOpenSnapshot)
  9.  
  10.     For x = 1 To 16
  11.         If rs.EOF Then Exit For
  12.         With frm
  13.         frm.Controls("qn" & x) = rs!QuoteLogNumber
  14.         frm.Controls("cust" & x) = rs!Customer
  15.         frm.Controls("sales" & x) = rs![Sales COOrd]
  16.         frm.Controls("prod" & x) = rs!ProductDesignInitials
  17.         frm.Controls("submit" & x) = rs!dtmTimeSubmitted
  18.         frm.Controls("total" & x) = rs!Expr1
  19.         frm.Controls("c" & x) = rs!PartsCompleted
  20.         frm.Controls("e" & x) = rs!ynExpedite
  21.         End With
  22.         rs.MoveNext
  23.     Next
  24.  
  25. Error_Handler_Exit:
  26.     On Error Resume Next
  27.     rs.Close
  28.     Set rs = Nothing
  29. '    Set db = Nothing
  30.     Exit Sub
  31.  
  32. Error_Handler:
  33.     MsgBox "The following error has occured." & vbCrLf & vbCrLf & _
  34.             "Error Number: " & Err.Number & vbCrLf & _
  35.             "Error Source: LoadMyForm" & vbCrLf & _
  36.             "Error Description: " & Err.Description, _
  37.             vbCritical, "An Error has Occured!"
  38.     Resume Error_Handler_Exit
  39. End Sub
  40.  
This populates the unbound text boxes based on my query. It is ran from a Timer Event set on my frmPDMonitor
May 7 '14 #3
Rabbit
12,516 Recognized Expert Moderator MVP
Where's the code for the save changes button?
May 7 '14 #4
Justair07
10 New Member
Hello Rabbit,

Sorry for the late reply.

Here is the code for my save changes button

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdSaveChanges_Click()
  2.  
  3.     On Error Resume Next
  4.  
  5.     If Me.Dirty Then Me.Dirty = False 'Force a save of the active record
  6.     If (MacroError <> 0) Then
  7.         Beep
  8.         MsgBox MacroError.Description, vbOKOnly, ""
  9.     End If
  10.     If CurrentProject.AllForms("frmPDMonitor").IsLoaded Then Forms![frmPDMonitor].Form.Requery
  11. End Sub
May 7 '14 #5
Rabbit
12,516 Recognized Expert Moderator MVP
Is there any code that runs when you click the checkbox? If so, please post that as well. When does the LoadMyForm function get called?
May 8 '14 #6
Justair07
10 New Member
Once my form is opened I use the onload event for the form to trigger a timer every second that calls the function. That's it for the code. Thank you by the way for your help with this.
May 8 '14 #7

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

Similar topics

1
by: Patrizio | last post by:
Hi All, I've the following table with a PK defined on an IDENTITY column (INSERT_SEQ): CREATE TABLE MYDATA ( MID NUMERIC(19,0) NOT NULL, MYVALUE FLOAT NOT NULL, TIMEKEY ...
7
by: Amy | last post by:
I'm trying to add an autoincrementing id to a table based on an existing field Name, but Name has duplicated records. How can I do that in ACCESS? Thanks. Amy
1
by: Isabel Puigdevall | last post by:
I'm trying to create a report in a dotnet.asp project. I made the report in Crystal Reports based on a dataset with two tables linked in a one to many relationship. The output report shows me...
1
by: anonieko | last post by:
> This is a common problem with some solution > > /*********************************************************************************** * * Problem: * Determine the Duplicated Records in a...
2
by: EManning | last post by:
Using A2K. I have a series of unbound textboxes on a report. I made a duplicate of these textboxes (Edit...Duplicate) to make a new series, then put this new series on another report. But I...
2
by: orenlevy1 | last post by:
Hi Everyone. I have a problem that I could not figure out what to do with it. I have a couple of tables and views. All have the same unique ID. When a user try to do a search on our web site...
3
by: hr833 | last post by:
I'm trying to check for duplicates from 2 table based on 2 fields. For example if the year and month is the same for table A and Table B then i will not import the record from Table B to Table A. ...
1
by: Davidsm | last post by:
Hi, please can you assist me with the following I am coming up with duplicated records in a table. I have run a find Duplicates query and it has listed all the duplicates. How do i run a delete query...
4
by: sanQUEST | last post by:
hi, can anybody can tell me how to add pry constraint to a table if it has already duplicated records ? san
1
by: Umesh Bane | last post by:
I have made the form with unbound textboxes and comboboxes. after filling the data in the text boxes by user, with the command button called 'add records' the records are transfer to the...
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...
1
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...
1
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
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
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 ...
0
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.