Thanks for the help. I figured out why the table was locked while checking your suggestions:
On my main form that the popup is initiated from there is a subform based on a query. This query is pulling data from my tblMasterList and my tblQueue. The popup button used to execute my INSERT INTO statement attempts to insert data into my tblQueue that is already open by the subform. My fix was to close the subform before opening the...
User Profile
Collapse
-
The form that the popup is opened from is unbound. On this form, however, there is a subform that is bound to a query.
The popup form is bound to my master table, except for the user input fields which are unbound. My insert statement is taking some of the info from the popup that is pulled from the master table along with the user input and inserting this information into a different table....Leave a comment:
-
Thanks for the response.
I checked the RecordLocks and they are set to No Locks.
I have tried inputting the date into my string textbox in various formats (i.e. 12-4-2007 and 12/4/07) and a MsgBox of my DueDteConv returns 12/4/2007. I'm not sure what else I can do to see the date format in the smart query designer...
As a side note, the reason I'm changing a string to a date is so that I can control...Leave a comment:
-
INSERT INTO locking table?
Greetings all,
I have a popup form that is mostly populated with information from a table based off a user's selection from the form the popup is initiated from. They select a record from a dropdown, which pulls the information displayed in the popup form.
In this popup form, the user then enters a quantity number and a few other details. When they click the "Add" button to run the sql statement and insert... -
Record Source Conflict
Greetings all,
I have a main form that does not have a record source. On that main form is a combobox that looks up values from the main table and is based off of a stored query. I also have a subform on the main form that is based on a different stored query. If a user picks an item from the dropdown, then manipulates the data via a popup form, it is then added on the popup close and will appear on the subform. I also have a button... -
Please consider this one closed. I figured it out.
I put the RunCommand in the On Timer event procedure of the form I was using to open and close my report to refresh it.
Code:Private Sub Form_Timer() Dim stDocName As String stDocName = "rptStatus" DoCmd.Close acReport, stDocName DoCmd.OpenReport stDocName, acViewPreview DoCmd.RunCommand acCmdFitToWindow
Leave a comment:
-
I think that I can use DoMenuItem, but can't find the right method to call the "Zoom" procedure.
I have tried using:
And I have tried using the index:Code:DoCmd.DoMenuItem acPrintPreview, acZoom ' just guessing here, the help files don't give a full list...
Does anyone know where to find a list of Access menubars, menu names,...Code:DoCmd.DoMenuItem 2, 6, 8
Leave a comment:
-
Access '97 - Preview Report at "Fit" size rather than default "100%"
Greetings,
I have a report displayed on a screen that anyone in the office can look at. The data on this report will change from time to time. This report has different colors displayed depending on the data. Since I'm using Access '97, I can't do this on a form. What I am doing is "refreshing " this report every 60 seconds. Since Access '97 can't use the timer interval for reports, I have a form that is closing and then... -
Ok everyone, please consider this thread closed. I have figured this out...somehow. I guess I just needed to have all the right variable definitions inside of the loop. It became hard to see the forest from the trees after staring at this for so long...
Here is my final code if interested...
...Code:Set db = CurrentDb() Set ScheduleParts = db.OpenRecordset("QueueInfo") DoCmd.SetWarningsLeave a comment:
-
OK, I figured out that whichever record that is highlighted/selected in the form is the record that is being inserted the number of times of existing records in the recordset. I have the recordset "QueueInfo" displayed as a continuous subform where the user will click to run the code displayed in this post. This is resulting in the top record having the black arrow selector default that Access uses and for whatever reason, I believe,...Leave a comment:
-
I will try to work with these latest suggestions, thank you.
I have a few questions though. If I need to use the edit..update functionality, why is the first record able to be inserted correctly several times? I am not trying to update a recordset, I am trying to update a table with data from the recordset.
Is there a way to delete a record from the recordset "SchedulePa rts" after it is inserted into...Leave a comment:
-
Here is my latest attempt that still results in the same first record in the recordset being inserted 9 times which is the recordcount of the recordset:
...Code:Private Sub ScheduleParts_Click() Dim ScheduleParts As DAO.Recordset Dim CheckQueue As DAO.Recordset Dim mySQL As String Dim ActTime As Single Dim RunHours As Single Dim EndTime As Date DimLeave a comment:
-
I've considered that and don't have a problem doing that. I was looking at that just now. I would still need to get the "queue" records into the "schedule" table and do not want the user to have to add them one at a time. I'm hoping for the flexibility to add a number of records, check that they are correct, delete any that shouldn't be in the queue and then hit the go button to run the schedule.
Anyhow, is...Leave a comment:
-
I am attempting to take row by row values from the recordset "QueueInfo" and perform a couple of calculations and then add that data and the recordset data to the table "Schedule" as a unique record.
Basically, the user will be able to add parts to a queue and then add them to a schedule. They select the parts into the queue which is a temporary tabledef and the query "QueueInfo" pulls master list data...Leave a comment:
-
FishVal - thank you for your comments. Unfortunately this results in the same single record being input 9 times.
puppydogbuddy - with your latest post, I'm getting runtime errors 3027, 3265, etc, depending on various methods I've tried to alter. This gives me a 3027 error with the debug pointing at the ScheduleParts.E dit:
...Code:Set ScheduleParts = db.OpenRecordset("QueueInfo", dbOpenDynaset, 0, dbOptimistic)Leave a comment:
-
Try:
This is for if your pNumber is calculated in the codeCode:strSQL2 = "INSERT INTO SubProj (Project, SubProject, Stundensatz ) SELECT "& pNumber &" , SubProjectName, Kosten FROM Mustertabelle WHERE Check = -1 "
or
...Code:strSQL2 = "INSERT INTO SubProj (Project, SubProject, Stundensatz ) SELECT "& [pNumber] &" , SubProjectName, Kosten FROM Mustertabelle
Leave a comment:
-
Thank you for your reply. I have made the changes and am still not getting the loop I need.
By removing the "values" portion of the SQL statement, do I need to replace it with a "Insert Into...Select.. .From"? I have commented out my SQL and have a MsgBox for the part number. It gives me the first record 9 times still...Any thoughts?
...Code:Dim ScheduleParts As DAO.Recordset Dim mySQL
Leave a comment:
-
Do...Loop Problem - Inserting same record
Greetings everyone,
I am working on a scheduling tool and have a temp table that I am attempting to loop through to pull the necessary info out of before deleting.
I am using Access '97 on Windows XP.
Here is my code:
[code=text]
Private Sub ScheduleParts_C lick()
Dim ScheduleParts As Recordset
Dim mySQL As String
Dim ActTime As Single
Dim RunHours... -
You could go the query route, but the missing item in your code is the definition of your stLinkCriteria similar to how you have stDocName="Repo rt1". You need to define this.Leave a comment:
-
You should not have wasted either of our time with your reply.
Of course I have tried the code and it doesn't work. I guess that I should have said something like "I'm not sure if this method will work or not, or if there is a better way".
Thanks for suggesting absolutely nothing but an insult.Leave a comment:
No activity results to display
Show More
Leave a comment: