I wonder if anyone could offer some advice on a problem with a form & subform?
I have a main form, based on table PublicationOrders:
POrderID (pk)
EventID(fk)
And a subform, EventDisplay, based on table Events:
EventID (pk)
EventName
The main form and subform are linked on the field EventID and my master and child links are correct, as far as I can tell.
The field EventID on the main form is a combobox, bound to field EventID in the table PublicationOrders. It allows the user to select which event an order is being sent to. In the Afterupdate property of this combobox, I have the code: Forms!PublicationOrders!EventDisplay.Requery
I would like the subform to update to show the details of the event that has just been selected from the combobox. However, for some reason, on afterupdate, the subform displays whichever event was selected when the previous record was entered. If I close and reopen the form, it will right itself and show the correct event information that corresponds with the order.
Any ideas why it's doing this? I have searched here for a solution but can't seem to find anything that relates.
I'm doing the simplest little 'INSERT INTO' type operation here with recordsets in Access 97 (SR2). Inserting into a table whose name is stored in the Const TABLE_CANDIDS.
I have a little piece of code that doesn't move on until the changes are committed to the table (usually this is just a single long integer being added).
The transaction takes up to a second to commit, and sometime doesn't commit at all. I tried putting begintrans and committrans around the loop but it seems to make the problem worse.
Can anyone spot my error?
Thanks, Rob
' Empty the TABLE_CANDIDS table then start filling it with the current ' list of Candidates DoCmd.RunSQL "DELETE * FROM " & TABLE_CANDIDS Set rstCandIDs = CurrentDb.OpenRecordset(TABLE_CANDIDS)
' Find the CandIDs for all selected items (default to select all) For Each objListItem In objListView.ListItems If objListItem.Selected Or Not blnSelectionOnly Then rstCandIDs.AddNew rstCandIDs!CandIDFiltered = CLng(objListItem.Text) rstCandIDs.Update lngCount = lngCount + 1 End If Next objListItem rstCandIDs.Close
' Wait for up to 1 second until the new value(s) are committed. Screen.MousePointer = 11 datStart = Now() Do While IsNull(DLookup("CandIDFiltered", TABLE_CANDIDS, "CandIDFiltered <> 0")) If DateDiff("s", datStart, Now()) > 100 Then Exit Do End If DoEvents Loop Screen.MousePointer = 0
I have a form with a subform (there is no child parent relationship) , when I open the mainform it causes the subform to slow down.
ie If I open the suform by itself - it opens quickly If I then open the main - it runs quickly
If I then open the main again it runs slow or if I open the subform again - it runs slow - it continues to run slow - until I have opened the sunform by itself.
So something in the mainform is causing the subform to slow down.
UPDATE (tblAFFIRMATION_REC_TOOL LEFT JOIN tbl_TZero_Spns ON tblAFFIRMATION_REC_TOOL.CptySPN = tbl_TZero_Spns.SPN) INNER JOIN Entity ON tblAFFIRMATION_REC_TOOL.ReferenceEntity = Entity.ReferenceEntity
SET tblAFFIRMATION_REC_TOOL.[Scope Reason] = IIf(IsNull(tbl_TZero_Spns!SPN) Or (Entity!Test='EM'),tblAFFIRMATION_REC_TOOL![Scope Reason],'TZero Trade')
WHERE ((([tblAFFIRMATION_REC_TOOL]![Scope Reason])="Affirmation Eligible"));
the way it right now, it's running for about half hour.. Could that be IIF statement that slows it down ?
I'm wondering if anyone has any idea how I can speed this form up. I have similar forms that don't calculate as much but are much faster when updating the date.
Basically, I have a make table query that pulls all units due to be delivered between a certain time period, that are a specific priority and we input how many days we want to push the delivery date back.
A form opens that shows the Job Code, Run, Door Style, Special Color, Lot Delivery Date, W/O Due Date, W/O Start Date and a Change check box. If the Change check box is selected the W/O Due Date moves back however many days entered. Based on the new W/O Due Date and whether or not a Raised Panel door or Special Color was selected the WOSD resets as well.
Here is the code I have used. It takes a little over a minute to update 1 line and we may need to move several lines. After all the units needed to move are selected, an update query is run updating the information in the actual tables used in the make table query.
Private Sub Change_Exit(Cancel As Integer) If Me.Change = True Then Call UpdateWODDChange Call UpdateWOSDChange End If End Sub
Private Sub Form_Close() DoCmd.OpenQuery "qryUpdateWODDPriorityChange" DoCmd.OpenForm "frmMenu"
I have a big application, which we updated to Access 2010 a month ago. It ran fine. Then we also just updated the data from 2003 to 2010. Now we have very slow searches of big tables/queries, and the tech says that 'cpu usage on the server has gone to 100%'.
What can be happening? Nothing else has been changed except that the data has been updated to 2010 accdb.
Hey firstly im at the end of the project ive spent months on and thats a MIS datase software. with all the bits and pieces and expert advise ive managed to learn a whole lot of things through this forum.
This is the problem i am having though;
i have a form that has two subforms embedded and since i have to use link tables because i placed the database file over a network somehow the loading seems to take forever, "it actually makes access inactive for about 50 seconds"
i would like to prevent the subforms from loading with the main form until after the main form is up and then i just click a button that makes both of them "appear" and load.
I'm having trouble with access. Basically it has been very slow to load (over 30 seconds when not opening a database) and when opening a database it just crashes.
Has anyone any idea what could cause this as it worked fine before ?
i have a main form with three sub forms on it. when i update subform 1 i want subform 2 and 3 to update..currently i have an after update event in a combo box subform 1
I moved this to it's own thread since it wasn't the same question as was posed by the thread creator. Pat
Not really the same issue but I thought to save us all from another thread...I have three subforms on a main form which are linked master/child. When I go through records on my first sub other two should be showing the additional info. I'm using requery as an form_current sub and works well with one sub, but doesn't work right with the other. The thing is that it shows the data on the form only if there is some data in the table already, but not if you want to add some new.
this is the code: ------------------ Private Sub Form_Current() Dim ParentDocName As String
On Error Resume Next ParentDocName = Me.Parent.Name
If Err <> 0 Then GoTo Form_Current_Exit Else On Error GoTo Form_Current_Err Me.Parent![tblInfoSub].Requery Me.Parent![tblInfo2Sub].Requery Me.Parent![tblKategorije subform].Requery End If -----------------------------------
since I am actually getting requery to work...what else might be the issue
I am building a debt management program in A2k. I have created a tabbed control which contains 6 pages based on a set of queries. These pages are a budget template and the intention is that when this form is inserted as a subform into the customers form the budget will open as a blank template with the budget categories displayed. The clients budget will then be entered and saved. The Budget table contains 56 budget categories.
At the moment when I insert the budget form and use it the only records that change are the template. I want the first 56 records to remain with zero values so that they display as blank for a new client but I want the total 56 new records to have the customer ID associated so that when that client record is accessed again their budget will appear. I have attached the SQL code for the query that displays a sub portion of the budget.
SELECT Budget.BudgetID, Budget.ClientID, Budget.SectionNumber, Budget.BudgetTitlesID, Budget.Description, Budget.Cash, Budget.Credit, Budget.Frequency, IIf([frequency]=1,([cash]*52/12),IIf([frequency]=2,([cash]*26/12),IIf([frequency]=3,([cash]),IIf([frequency]=4,([cash]/12),0)))) AS Totalscash, IIf([frequency]=1,([credit]*52/12),IIf([frequency]=2,([credit]*26/12),IIf([frequency]=3,([credit]),IIf([frequency]=4,([credit]/12),0)))) AS Totalcredit FROM Budget WHERE (((Budget.ClientID)=[forms]![customers].[clientid]) AND ((Budget.BudgetTitlesID)=1)) OR (((Budget.ClientID) Is Null) AND ((Budget.BudgetTitlesID)=1));
My thought was to do an after update event that would copy the clientID from the main form to the sub form and populate all the records in the budget. However, I have only succeeded in populating the individual record that has changed.
I probably haven't explained the problem sufficiently to get some help but would appreciate any thoughts.
I have a subform which asks a user to confirm the update before it happens - if the user selects no - then the update is cancelled.
When the parent (they are not related record wise) form is closed the update on the subform is attempted - if the user selects no - how can I cancel the close of the parent form. At the moment a message saying "Cannot save the record at this time - changes may be lost". Which I don't want to see.
Hello all! I'm using a form in data entry mode to add new orders into a table. When the Save button is pressed, an append query posts the order number and date to another table, and then enables a subform for data in that table. The subform is linked to the main form by the order and date to get only the record that was just entered/created.
While the subform does display the desired record, the user cannot update other fields in that table through the subform. I've searched all over the forums, and I'm probably missing something really simple. I've tried turning data entry on and off, changing different subform properties but to no avail. I can filter out the proper record on the subform, I just can't update it! Any help would be much appreciated. Thanks!
I have a form called NewRequisitions that had a combobox in which the users select the Supplier (name, address, shipping details). I created a button to open a subform called NewSupplier so that they can add a new supplier to the Supplier table as needed. My code works okay for the first "NewSupplier" entry - the table and combobox are both updated and the new supplier is available for selection in the dropdown list. However, when there is a 2nd record that needs a NewSupplier added the combobox list doesn't get refreshed. The record is added into the table okay but you can only view it if the NewRequisitions (main) form is closed and then reopened.
Here is the code in my subform:
Private Sub Form_Close()
If CurrentProject.AllForms(NewRequisitions).IsLoaded Then
'save the record if there have been any changes If Me.Dirty Then Me.Dirty = False
'requery combobox on other form Forms!NewRequisitions!ComboSupplier.ReQuery
'yield to other events - and put the new list into use DoEvents
Hi everyone. This probably sounds simple, but I cannot find the answer here, google, or my books (don't know if I'm searching the right words). I have a main form with five parmeter values, any of these acn be filled in, to filter the results in a query. I created a subform to display these results, however I cannot get the results to come up in the subform inside the main form. All I can get is the subform opening up in its own window, and even when this happens the subform inside the mainform stays the same. The only way I get the subform inside to update is by going into design mode and then back into formview mode. What have I missed or what am I doing wrong?
Hi got a good help with this and it's near a solution. I attached a form that has checkboxes to show and hide fields. This is a subform in a search form and bound to ID. So if a person is checked for "eget initiativ" it sticks to him/her. but the problem is that this should hide 2 textboxes, but if a person before has the bos checked for showing them, they doesn't hide when I filter the next person that has "eget initiativ check that's supposed to hide them.
If you uncheck it manually and check it again, they disapear. But that's not good enough. Any suggestions?
I have a private sub on a subform called txtsearchstring_change.
The txtsearchstring box is = to the client_id on the main form.
Basically when the user clicks on the next record button (which is on the main form) it should update the txtsearchstring_change on the subform and then display the new results in the list box.
Im not to sure how to do this. I understand im calling a sub from another form, so i did try a public not a private sub. And i have added on the next and previous button - txtsearchstring_change.
I have a form that has a related pop up from. I have an IF/Then/else statment. I want to up date a field in the orginal form from that if/then/else statement. I can get my IF/Then/Else statement to work on the subform but I can get it to update the orginal form. I might have a problem with my forms![xxxx]![yyyyy] syntax.
This is so simple but I can't seem to make it work. I've poured through about 30 posts and tried all kinds of AfterUpdate event strings to no avail. Help!
Here is the simple setup. I have one table that lists employees and their corresponding teamleader. A grouped query provides the record source for a combo box. The idea here is that you select a teamleader from the combo box and a subform updates to show all the corresponding employees. This subform is based on a simple query of all fields on the table.
After a scary recovery I have a new problem: Intially I changed the 'Data Entry' property on a subform, in a multi-tab form :eek: My tabs all dissappeared. (My Bad!:o ) Now that I have recovered I get a message when I close the form, asking do I want to save the changes to the design of the query. This only seems to happen when I have read a second or third etc record that displays a different set of records in the subform. This is a HR mdb with leave records in the subform. Any help would be appreciated. PS I thought I had posted this 2 hrs earlier, but can't seem to find it. Hoping this isn't a second posting ...:confused:
Hi, I am trying to update a subform by selecting a record in a combo-box that corresponds to a particular test when i select the said test i want an adjacent subform to change to the form displaying the test data in the subform window i have tried to use VBA to achieve this but so far have been unsucessful does anybody know how this can be done?
I'm trying to pass a value from my main form to my subform for the related records when the user clicks a button. The problem is that it either wants to update the entire table or can't "see" the value on the main form.
Here is my code
DoCmd.RunSQL "UPDATE [tbl_req_order] SET [process_status_rec_id] = [req_process_status_rec_id] WHERE req_rec_id = Me!req_rec_id;"
I'm a novice, so please bear with me. It works, but it always asks me what the value of Me!req_rec_id is. That's the primary key in the parent table that is linked to the subform. How can I tell it to use the value for the form the user is on?
I want to limit the values in a subform using a combo box. Basically I've got a Main Form that has name field etc. Selecting a different record shows me a different entry on the subform relating to a different name but now I want to use a combo box to limit what I see in the sub form another level. Any help would be wonderful.