Conflicting Inserts?
Jul 7, 2006
I have an application set up as follows:
Live front end in one network folder, accessible by all users.
Development front end in another folder accessible only by myself (changes imported into Live as and when necessary).
Back end in another folder accessed by both front ends.
One of the tables contains orders made by various people. The way the data entry form is set up is that, once a person's ID has been entered, all previous orders are displayed in a sub form at the bottom of the screen.
I'm noticing that, if two people are entering new records into it via two different PCs, it sometimes happens that one person can see an inserted record, only for it to later vanish from both the form and the underlying table. There is no pattern to these 'disappearances', but it's obviously concerning.
Possibly more worrying is that, from time to time, all records for the person being updated are being lost, not just the most recent entries being made.
I have the database set to Record Level Locking. Can anyone suggest anything else I should be looking out for or should have done?
The only other thing I can think of is that I sometimes enter records from the development version, while it is open in development mode, with just the data entry form being out of design mode. Would that make a difference? If so, why?
I'm stumped here.:confused:
View Replies
ADVERTISEMENT
Nov 15, 2004
I'm having an issue with two programs. One searches the DB and emails the results, the other searches the DBand prints labels from a report. When only one is in there the program will run fine. But when I try to implementboth at once then I get an error message that is something like: The expression On Click you entered as the event property setting produced the following error: Ambiguous name detected: SQLSafeThe way the form is setup I am using the same text box to enter my search criteria and the same option groupbox with my check boxes for what I'm searching for both programs. Is this possibly the conflict? Am I going to haveto have seperate option groups and search criteria boxes for each program? It would be nice if I don't because thiskeeps the look of my form clean. Thoughts?Code for Search Database and Send Email
Code:'Designed by M. Walts'Important information! this code requires a reference to the Microsoft DAO object libraryOption Compare DatabaseOption ExplicitPrivate Sub cmdEmail_Click()'will hold the dynamic SQL queryDim strSQL As String'will hold the WHERE clause portion of our SQL queryDim strWHERE As String'will hold all the recipients of this messageDim strRecipients As String'the recordset we will use to get the emails of the records that match our criteriaDim rst As DAO.Recordset'if there is input in the search criteria, then we will run the query and send the e-mailIf txtSearch <> "" Then'if you have more buttons, just add mosr cases (the value of the radio button'= the Case number, so Value of the State radio button is 1, etc.)Select Case opgSearch.ValueCase 1strWHERE = "WHERE State = '" & txtSearch & "'"Case 2strWHERE = "WHERE City = '" & txtSearch & "'" End SelectstrSQL = "SELECT EMail FROM tblUser " & strWHERE'run the query and get the results into the recordsetSet rst = CurrentDb.OpenRecordset(strSQL)'Loop through the recordset and add all the EMailsDo While Not rst.EOFstrRecipients = strRecipients & ";" & rst!EMailrst.MoveNextLoop'remove the first ; from the strRecipientsstrRecipients = Right(strRecipients, Len(strRecipients) - 1)MsgBox strRecipientsDoCmd.SendObject , , , , , strRecipients, txtSubject, txtBody, Falserst.CloseSet rst = NothingEnd IfEnd Sub'stops a ' entered in the field from breaking the queryPrivate Function SQLSafe(safeMe As String) As StringSQLSafe = Replace(safeMe, "'", "''")End FunctionCode for Search Database and Print LabelsCode:Private Sub printLabels_Click()'Edited by Nicholas Brown, original code design by M. Walts'Important information! this code requires a reference to the Microsoft DAO object library'will hold the dynamic SQL queryDim strSQL As String'will hold the WHERE clause portion of our SQL queryDim strWHERE As String'will hold all the recipients of this messageDim strRecipients As String'the recordset we will use to get the emails of the records that match our criteriaDim rst As DAO.Recordset'if there is input in the search criteria, then we will run the query and send the e-mailIf txtSearch <> "" Then'if you have more buttons, just add mosr cases (the value of the radio button'= the Case number, so Value of the State radio button is 1, etc.)Select Case opgSearch.ValueCase 1strWHERE = "WHERE State = '" & txtSearch & "'"Case 2strWHERE = "WHERE City = '" & txtSearch & "'"End Select DoCmd.SetWarnings False DoCmd.DeleteObject acTable, "tmpClients" strSQL = "SELECT tblUser.* INTO tmpClients FROM tblUser " & strWHERE DoCmd.RunSQL strSQL DoCmd.OpenReport "Labels", acViewPreview 'just view for testing, switch to print mode later acViewNormal DoCmd.SetWarnings TrueSet rst = NothingEnd IfEnd Sub'stops a ' entered in the field from breaking the queryPrivate Function SQLSafe(safeMe As String) As StringSQLSafe = Replace(safeMe, "'", "''")End Function
View 3 Replies
View Related
Oct 9, 2013
I am working on an older database that was built on the 2002/2003 version of Access. When we converted to 2007/2010 Access we lost a small function of the database and cannot find a way to override it. We have a report that prints all names with a summary of hours by the quarter. The database retains all data. After conversion the report will not print all names, only those that were in the database prior to conversion and those with hours in the current quarter. Is there a way to write a multiple set of criteria that will allow the names and the dates to function separately?
View 13 Replies
View Related
Jun 14, 2005
This one is very annoying...
i have a button that is supposed to update a record based on the record id. when i click the button, it not only updates the record, but it also creates a new record with just the default values i have set for the table. no other values are entered into the table. here is the code that is relevant to the problem:
Code:Dim DAOdb As Database Dim DAOrs As dao.Recordset Dim sSQL As String Set DAOdb = CurrentDb() sSQL = "Select * from StopwatchRecord where StopwatchRecord.ID=" & Me.hidID & ";" Set DAOrs = DAOdb.OpenRecordset(sSQL) With DAOrs .Edit .Fields("StartTime") = Me.StartTime.Value .Fields("EndTime") = Me.EndTime.Value .Fields("ElapsedTime") = Me.ElapsedTime.Value .Fields("Comments") = Me.Comments.Value .Update End With MsgBox "Record Saved" DAOrs.Close DAOdb.Close
Please help! this is driving me nuts
thanks
*j
View 12 Replies
View Related
Nov 12, 2014
- I currently have a table that is labeled WorkSchedule. I then Created a query called WorkSchedule Query.
- The column labels are as follows (listed from right to left): Project, Event (something inside of the project), Employee1, Employee2, StartDate, EndDate
- I created a split form that shows each record.
- On each record I made the employee1, and employee2 as a drop down box that allows you to pick from all employees.
*MY QUESTION*
How do I make a pop up form appear when there is a conflicting date based on the employee I picked?
For example: If I had assigned Rebecca to an event that went on from 11/12/2014 - 11/14/2014. Then I tried to assign her to another event from 11/13/2104-11/15/2014. I want a pop up message saying that these dates conflict.
View 2 Replies
View Related
Aug 29, 2007
I am trying to issue multiple INSERT statements in a row - but it seems that only the first succeeds. If I put a 1-second delay between attempts, suddenly they all succeed (so I know the statements themselves are all valid, it's not a data issue).
These are all being issued in a loop from the same thread, so as far as I can see unless the data is being inserted asynchronously, I can't see any problem. If it is being done asynchronously - how are we supposed to know one INSERT succeeded and thus we can issue the next one?
Anyone have any idea why this might happen? I don't want to leave 'magic delays' in the code!
View 2 Replies
View Related
Nov 18, 2006
Hi All,
I have been searching and can't seem to find how to solve my problem. I have a sub form that allows adding new rows to a database. The detail contains a combobox and a few text fields. When I enter data everything works fine. However when I accidently tab into the next row (new blank row) and then try to get out of the form without adding a new row I get an error about "Index or Primary Key cannot be null" or something like that.
It is very frustrating because I can't exit the form until I add data to the new row and then leave without tabbing to much (thus creating another new row with no data).
How do I trap the new row and only allow the insert if it has data in it?
Thanks.
View 1 Replies
View Related
Oct 2, 2014
I have a database with two tables. One with a schedule that lists all of the events with the person assigned to, with there start date and end date in separate columns.
My second table lists a persons leave. So I have there name and the start and end date of their leave in separate columns.
Is there a form/query I can create using VBA that will allow me to filter out all the criteria that has the same name and then a date that conflicts between the event date and the leave date.
for example,
If Name(in table 1 ) = Name (in table 2)
(if false stop)
AND,
If StartDate (from table 1) and EndDate (from table1) conflicts with StartDate (from table 2)and EndDate (from Table 2)
(if false stop)
If true I want either the query to register it OR have a form appear to show the conflicting entries.
View 1 Replies
View Related
Jun 3, 2006
hello!
I'm wondering how would I, in Access, make a query that would let me do a UNION and then insert that data into a table?
Is there a way that I could achieve that in one(1) query?
I've tried with INTO, but I get an error.
(i'm using access 2000-2003)
thanks!
View 1 Replies
View Related
Jan 23, 2006
I have set certain fields on my main form to be required to protect from accidnetal skipping which has occured in past. However, in middle of form, there are a group of checkboxes, which opens their correndsponding popup forms for more details. Right now, I get an error if it try to pop up a form because not all required fields are filled in.How do I make Access suspend the requirments whenever the checkboxes are checked and additional info are being inputed?Edit= tried setting it as dialog boxes, but to no avail.
View 9 Replies
View Related
Apr 30, 2015
I am writing the following query to insert data in tblpostroom from another table. Both the tables have same field names like Date1,582,1810.Now If I run the following query then in the fields 582,1810 of tblpostroom , the data gets stored 582,1810 respectively for all the records. But in actual fields 582 and 1810 store different data.
Code:
INSERT INTO tblpostroom ( Date1, 582, 1810 )
SELECT Date1, 582, 1810
FROM Sheet1;
View 5 Replies
View Related
May 18, 2006
While in datasheet view, i enter a value in a text field, then
press the down arrow key. Access then places (on it's own
i might add), a value (from %$&$% thin air) which it must
believe i wanted to add.
The value seems to be a prediction of what should be
in the field, based on previous entries.
How do I stop such nonsense? Anybody.
View 9 Replies
View Related