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
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.
Here is the code used in a standard module in access. -
Public Sub LoadMyForm(frm As Access.Form)
-
On Error GoTo Error_Handler
-
' Dim db As DAO.Database
-
Dim rs As DAO.Recordset
-
Dim x As Integer
-
-
' Set db = CurrentDb()
-
Set rs = db.OpenRecordset("qryPDMonitor", dbOpenSnapshot)
-
-
For x = 1 To 16
-
If rs.EOF Then Exit For
-
With frm
-
frm.Controls("qn" & x) = rs!QuoteLogNumber
-
frm.Controls("cust" & x) = rs!Customer
-
frm.Controls("sales" & x) = rs![Sales COOrd]
-
frm.Controls("prod" & x) = rs!ProductDesignInitials
-
frm.Controls("submit" & x) = rs!dtmTimeSubmitted
-
frm.Controls("total" & x) = rs!Expr1
-
frm.Controls("c" & x) = rs!PartsCompleted
-
frm.Controls("e" & x) = rs!ynExpedite
-
End With
-
rs.MoveNext
-
Next
-
-
Error_Handler_Exit:
-
On Error Resume Next
-
rs.Close
-
Set rs = Nothing
-
' Set db = Nothing
-
Exit Sub
-
-
Error_Handler:
-
MsgBox "The following error has occured." & vbCrLf & vbCrLf & _
-
"Error Number: " & Err.Number & vbCrLf & _
-
"Error Source: LoadMyForm" & vbCrLf & _
-
"Error Description: " & Err.Description, _
-
vbCritical, "An Error has Occured!"
-
Resume Error_Handler_Exit
-
End Sub
-
This populates the unbound text boxes based on my query. It is ran from a Timer Event set on my frmPDMonitor
Rabbit 12,516
Recognized Expert Moderator MVP
Where's the code for the save changes button?
Hello Rabbit,
Sorry for the late reply.
Here is the code for my save changes button - Private Sub cmdSaveChanges_Click()
-
-
On Error Resume Next
-
-
If Me.Dirty Then Me.Dirty = False 'Force a save of the active record
-
If (MacroError <> 0) Then
-
Beep
-
MsgBox MacroError.Description, vbOKOnly, ""
-
End If
-
If CurrentProject.AllForms("frmPDMonitor").IsLoaded Then Forms![frmPDMonitor].Form.Requery
-
End Sub
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?
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.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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 ...
|
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
|
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...
|
by: anonieko |
last post by:
> This is a common problem with some solution
>
>
/***********************************************************************************
*
* Problem:
* Determine the Duplicated Records in a...
|
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...
| |
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...
|
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. ...
|
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...
|
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
|
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...
|
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...
| |
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: 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: 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...
|
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...
|
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: 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...
| |
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 ...
|
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...
| |