A user yesterday informed me I need a me.requery. I have a form with tabbed pages. First page I complete details of clients - second page goes into more detail. On second page I have a combo box listing all clients in alpha order. I want to get the new client I have just completd on first page into that combo box without having to close and re-open form. Does this code go against combo box, or page? Is there anything I need to add to this code, like form name? Have tried in various ways without success.
I have a strange problem. On some forms with listboxes, when I close (via a close button) the listboxes want to requery after the form closes prompting a parameter box to pop up. I have no code inserted to do this. If I file-close, it works fine.
However some users don't report this to happen on their PC's. All are supposed to be set up the same though with me as an exception (having it fully installed).
I tried converting it to 2000 then back to 2002 (after trying compact-repair) which did fix it for me opening holding the shift key, but not if I open it like everyone else. We just got new PC's running XP pro from 2000. Access version is 2002 and did not change.
Any ideas? Our internal programmer is stumped as am I. He just says "that's why Access shouldn't be used for anything". I develop basic apps in Access and he hates it so I have to make sure it's perfect before rolling things out or I'll be back to the stone ages.
Works great, but when I hit the number "3", (3 times in row) it will let me into the form. I want it to not let me in IF I don't know the password.
Where did I go wrong?
Private Sub Form_Load() Dim pw As Variant
If InputBox("What is the password?", "Password") = "1" Then Else MsgBox "Invalid Password", vbCritical, "Sorry Charlie" DoCmd.Close If InputBox("What is the password?", "Password") = "2" Then Else MsgBox "Invalid Password", vbCritical, "Sorry Charlie" DoCmd.Close End If End If
Hi, I have a search form and a form that display the result of the search based on the search criteria from the search form. The query works just fine and the search results are displayed well but the problem is the following: the query doesn't work with the new records inserted in those tables, only records that were in the table at the moment i had developed that search button are displayed. If someone can tell me if there exist a sort of "requery" method for that query to display the new records.
I have a combo box [product] on my main form. On AfterUpdate of the combo I have it set to run a DLookup on a query (which is created with "tblPlan") and place that calculation in another field [costsavings]. This is working great, however, I update tblPlan each month and want it to update the calculation when I open the form instead of having to re-select the product again to trigger the query.
I have tried Me.Requery and Refresh for both the form and the combo on the main form's OnOpen and OnActivate events and it does not work.
Could someone please tell me where I need to place the code?
I have a form ("Clients") that points to a "Clients" table. I also have a form ("AddEditClient") that points to same table.
Open Clients form and you see client info. Have at the bottom 2 buttons. One to create a new client and one to edit the current client. B/c we do not want user to edit clients from main client form (most fields are locked on this form). So if the user clicks on "edit client" button takes them to same record on AddEditClient form... now they can edit the client (fields are not locked). If they click the "add client" button it takes them to a blank new record on the AddEditClient form. To this point all is good.
On the AddEditClient form there is only one button ("Finished" button). If they were editing an existing client I want it to return them to the same record on the client form and making sure to display the new data. If they added a new client then I want it to display that new client on the client form. If selected the new client button but then did not add a new client and simply hit finished then it opens the client form on the first record of the client table. I have it half way working right.
My problem is that if they added a new client then it does not send them back to that client. I think I need a REQUERY statement... but it seems that no matter where I put it, it breaks my opening of the correct record and then starts sending me back to the first record of the client table. My current code for the "Finish" button on the AddEditClients form is below. There is some extra stuff in there b/c I have been playing around with this for a day or two now.
Where does the requery statement go (and what is the proper syntax)? (or if this is a bad way to do this... how am I "suppose" to do it?) I had toyed around with closing one form before opening the other but then I was unable to pass back and forth my client id (key index number). As it stands now, I can not get my data refreshed (mainly a problem if a new client was added). If I put in a requery statement then I lose my position on the Client Form. So now the user would have to search for the client again. I feel like I am running in circles.
Client Form ---> points to Client Table but is essentially read only AddEditClient Form ---> points to same Client Table but has full access ClientK_ID ---> the key index for the Client Table... the field I am trying to use to navigate the tables from the two forms.
Dim stDocName As String Dim stLinkCriteria As String
stDocName = "Clients" If Me![ClientK_ID] > 0 Then DoCmd.Close acForm, "AddEditClients", acSaveYes
Basically I just want to be on a client... click an "edit" button to change their info. Then click a "finish" button and return to a mostly read only screen for that client. Or if I need to add a new client... click an "add" button... add a client then click "finish" and open that newly added record as mostly read only.
Unfortunatly I can't do this as a mode change... because on the Client form there are a few fields that are not read only.
I have a form which consists of an unbound combo box and two subforms. Now i would like that when i will select a value from the combo box, the two subforms will display the related records based on the combo's selected value.
What is the correct syntax to requery the subforms, after i select the value from the combo box?
I have been reading a earlier post regarding requerying forms
Forms are displayed on other form by means of a SubFormControl. It is the name of the SubFormControl that is needed. This is often the same as the SubForm but it is *not* a requirement. In your case you will be using two SubFormControl names, one nested within the other. Just for the record, you Requery forms and not fields.
How do you find out the name of the SubFormControl. I am trying to refresh sub forms and I am trying to use the following code.
Private Sub Form_AfterUpdate() Forms!MainFormName!SubFormControl.Form!SubSubFormC ontrol.Requery End Sub
I have 2 forms, "frmMainClient" and a subform "frmjob" and I have a command button on the "frmJob" which brings up a pop up form " frmJobNew". I fill out the fields and save via a command button.
When I look at the "frmJob" the new record I have entered is not there. It is there if I close all the forms and then open them again.
I know I need to requery the forms but I am not too sure how this is done.
I have an "On Double Click" code in the second Combo box of a cascading combo box set. The code below works fine on a normal Combo Box, but for some reason the Requery statement doesn’t seem to have any effect in this instance. The data that has been entered into "FRM_DelPoint" does not appear (in the second Combo box [Combo18]) unless the First combo box in the set is changed :mad:
What have I got wrong?
Private Sub Combo18_DblClick(Cancel As Integer) On Error GoTo Err_combo18_DblClick Dim lngcombo18 As Long
If IsNull(Me![Combo18]) Then Me![Combo18].Text = "" Else lngcombo18 = Me![Combo18] Me![Combo18] = Null End If DoCmd.OpenForm "FRM_DelPoint", , , , , , acDialog DoCmd.GoToRecord , "FRM_DelPoint", acNewRec Me![Combo18].Requery If lngcombo18 <> 0 Then Me![Combo18] = lngcombo18
Exit_combo18_DblClick: Exit Sub
Err_combo18_DblClick: MsgBox Err.Description Resume Exit_combo18_DblClick End Sub
I'm trying to requry a sub form based either or both text boxes. I need help with the code. I'm trying to rewrite something from a sample but can't seem to get it to use the criteria. It does requery though.
Private Sub cmdSearch_Click() Dim sCriteria As String sCriteria = "WHERE 1=1 "
If Me![Search] <> "" Then sCriteria = sCriteria & " AND MedicalRecordsUpdating.SerialNumber """ & Search & """" End If
If Me![SearchEvent] <> "" Then sCriteria = sCriteria & " AND MedicalRecordsUpdating.Event """ & SearchEvent & """" End If
I've been trying to apply a requery, but still can't get desired result. My db structure: I have an input form with 4 tabbed pages. First page of form is for entering basic details of a client. Second page goes into more detail. At top of second page, I have converted text box into a combo box and through query builder all client names appear within combo box in alpha order, so user does not have to retype client names. Trouble is the client name does not appear in combo box unless I close and re-open the form. Rickster57 kindly gave me code for a requery of:
I'm performing a DSum on a subquery that adds up percentages for different customer types. Whenever the percentage is changed the DSum needs to reflect that so the person doing the data entry knows that all the percentages add up to 100.0%. I set up a requery macro for this function. This worked fine until I started doing sample entries. It wouldn't let me put in a decimal point. So I went into Visual Basic but I think my code is bad:
I am new at Access and have a database that has 2 tables (Donors and Donations). My donations form's source is a query. I have a combo for the DonatorID on the Donations form. I have a On Not in List macro that opens the Donors form so they can enter the name of a new donor. This works great but when you close the Donor form and the focus goes back to the DonorID combo, the new donor isn't in the list. How can I requery this so the new donor that was added to the Donor table shows up in the combo? I played around and added another combo that had tab index 0 and then everything works but this aint the solution.
I have a form that allows my users to enter transactions. The transactions are entered on a subform in datasheet view. At the top of the main form is a continuous form that shows a cash balance figure.
On the After Update Event of the subform I requery the continuous form to reflect changes. This works when new records are added or existing records are modified but the cash balance does not update when a record is deleted.
I have a 'frm_New_Client' which adds a record to a 'tbl_Individual' and updates info in 'tbl_Case.' Then I try to use some code to requery another form which is based on the same table. In the past, this code has worked, but something is wrong here. When I use the code to requery another form, that other form is not requeried at all. When I go to that other form and push a button with "Me.Requery" underneath, it requeries those tables with updated info, but does not bring in new records from the appended table. If I close the form and reopen, then all the new data is there--shouldn't I be able to do that without closing the form?
All tables are linked. What am I missing? Here is my code from frm_New_Client:
'requery my other form Forms![frm_Face_Sheet].Requery
I've seen this or a similar question answered several times, but still haven't found the answer that works for me, so here goes (fyi, I'm relatively new to Access and all self-taught)...
I have a form that lists agencies and addresses with a subform for agency contacts. The contacts are in a list box and the rest of the subform shows the phone number/email/etc.. of the selected contact person. I wanted to be able to add contacts, so I created a popup form that prompts for the name of the new person. After clicking OK to close the popup I'd like the list box on the subform to update with the new contact name. I've tried all combinations of requerying/refreshing/resetting the RowSource of the list box... but to no avail. The best I've been able to do is that if I add two new contacts (by calling the popup form twice), when I click OK the second time the first new name shows up in the list box.
I have an option group that when an option is chosen it changes the value in a text box. My problem is if you change your option choice it doesn't update the value in the text box until I close the form and open it again.
I tried Requery in the After Update of the Option Group but then I went back to the first record and not the record I had been working on.
I'm having trouble updating a combo box automatically. I have a main form [Orders] containing a combo box with a list of Buyers. Inside this main form is also a subform, [Order Details], containing products to be ordered which is also selected by a combo box. However, each buyer has a different set of products. I tried filtering for only the products by a certain buyer but when I go to a new record, the product list remains the same according to the buyer on the first record when the form was opened. What do I need to do inorder to have only the products for the chosen buyer appear in the combo box when a buyer is selected in the main form?