Forms :: Split Form Combobox Requery Based On Row Selected
Oct 2, 2013
I have a split form that was not made by wizard. On the form part I have a combobox that is unbound to the form data set. The combobox has a query row source that is based on the current row selected. I want the combobox to have an up-to-date result based on which row is selected.
If I set the combobox to requery in the form_current event then I get what I want. I don't want to put up with the little delay that is generated every time a user changes rows because of the requery, though. I only want the requery to happen when they use the drop-down menu.
I have the requery in the gotfocus event of the combobox on the form. I mostly get what I want this way, however if they select an item in the drop-down list, then choose a new record in the datasheet, then try to use the combobox again, the combobox is not refreshed (because it never lost focus?).
To get around this, I've tried to setfocus to something on the form in the on_current event, but access gives me an error: 'Access can't move focus to the control btn_Refresh'.How can I get the combo to requery only when users are about to use it?
View Replies
ADVERTISEMENT
Apr 26, 2015
I am trying to use a combobox called Manufacturer to select which table the combobox called Model gets it's rowsource from using the code below.
Code:
Private Sub Manufacturer_AfterUpdate()
If (Me.Manufacturer.Value = "Siemens") Then
Me.Model.RowSourceType = "Table/Query"
Me.Model.Recordset = "SeimensTable"
Me.Model.RowSource = "SELECT Model FROM SeimensTable"
Else
If (Me.Manufacturer.Value = "Samsung") Then
Me.Model.RowSourceType = "Table/Query"
Me.Model.Recordset = "SamsungTable"
Me.Model.RowSource = "SELECT Model FROM SamsungTable"
End If
End If
End Sub
But when I run the form and select Manufacturer. Combobox Model remains empty. tell me what I'm doing wrong?
View 5 Replies
View Related
Sep 10, 2014
Is it possible to have a query that will requery value of a check box based on which check box is selected? I have a form that has 5 check boxes and a text field for populating a unit price. When someone clicks a specific check box, the text field should display the unit price. I know how to accomplish this using a combo box and don't want to change the form to setup for a combo box, but rather use what everyone is currently used to. I want to add the check box is from 1 table linked to a form and the unit price is from another table not linked to a form. Both tables have 2 fields in each that will relate.
View 6 Replies
View Related
Apr 1, 2013
I have a suppliers table and a products table. Two forms, Stock form with combobox to list Suppliers and a sub form with combobox that lists Products.I want to select a supplier from the Stock form and then the combobox in the subform to only list products directly sold by the Supplier.Have dabbled in SQL as follows:
SELECT Products.ProductID, Products.ProductName
FROM Suppliers INNER JOIN Products ON Suppliers.SupplierID = Products.SupplierID
WHERE ((Stocksubform.SupplierID=Stock.SupplierID))
ORDER BY Products.ProductName;
View 2 Replies
View Related
Apr 2, 2014
I have a main form that identifies a Client File: frmClientFile (Single Form)
On the main form is a subform for Cases: subfrmCases (Continuous form)
Also on the main form below the Cases subform is a tab control that contains additional subforms to view/update different aspects of a case: subfrmCaseClients (Continuous Form).
The way this operates is that the user first chooses a file using a combobox on frmClientFile.
The subfrmCases is linked to the main form (using the caseFileID) and filters correctly.
The subfrmCaseClients is then linked using some hidden text fields on the main form (using caseFileID, CaseID) and this filters correctly.
On subfrmCaseClients is a combobox (cboClientID) that I need to requery based upon the Case Row selected on subfrmCases.
I have tried numerous combinations of options to force the requery by trying to apply a macro on the following:
OnCurrent, OnSelectionChange, OnChange and AfterUpdate events to no avail.
If I hit F5 to refresh the entire page the combo box gets updated as expected.
How do I get the Requery to work programatically? Is this even possible?
View 2 Replies
View Related
Jul 30, 2014
I have a form "Clientfrm" with a field, "ClientID".
I have another form, "HomePage", with an unbound combobox with rowsource "ClientID" from Clientfrm. Along with that, I have an Open Form button that pops up "Clientfrm" to display existing data if an existing ClientID is typed.
SITUATION: A nonexistant ClientID is typed into "HomePage", a blank "Clientfrm" pops up with the field "ClientID" blank on the Clientfrm. Once filled out and closed, I am back to the "Homepage" to enter another "ClientID". However, the combobox does not display the new "ClientID" until the "Homepage" is closed and reopened. How do I fix this?
I tried the Me.ClientID.Requery on the On change event of the combobox of the "Homepage", but that is not working. What should I do? SHould I instead put that code in on change event in the "ClientID" field in the "Clientfrm?"
View 14 Replies
View Related
Jun 18, 2015
I set up several combo boxes to display Tables from msysobjects. The record source is using a WHERE clause to display certain tables both Linked and Local. Occasionally, when clicking the dropdown arrow, the box only displays local tables. This situation seems not to matter whether tables have been newly linked or unlinked. despite having both a me.requery and a me.refresh in the code and/or even clicking the Refresh All button on the ribbon menu, the form does not seem to update the combo box to display both linked and local tables.
In further testing, it seems that it is not a form issue because I took the SQL statement I used as the record source and created a new query with the sql string. The query behaved the same as the combo box, only listing out local tables.
My current work around is to close the database and reopen, then all is well. Hopefully there is another way to get the linked tables listed without this drastic step.
Don't think it's necessary, but here is the sql statement. Type 6 is linked.
Code:
SELECT msysobjects.name
FROM msysobjects
WHERE msysobjects.[flags] = 0
AND msysobjects.[type] in (1, 6)
AND Right([name],7)<>'_SOURCE'
AND Right([name],4)<>'_OUT'
AND msysobjects.name not in ('tblImport','tblImportFormats','tblUniversal') OR msysobjects.database=gblprojectname()
ORDER BY msysobjects.name, Right([name],7);
View 9 Replies
View Related
Dec 29, 2013
I have a form that is filter based on a combo box. I would like to add another filter for date. but the code I'm using for the first combo box doesn't work for date.
the code is:
Sub SetFilter()
Dim LSQL As String
LSQL = "select * from Preventive_Q_View"
LSQL = LSQL & " where Item_Name = '" & Combo206 & "'"
Form_Preventive_View.RecordSource = LSQL
End Sub
How do I modify this code to work with the date combo box? Also, is there a way to get both filters to work together, as in filter based on the first combo OR the second combo, OR both?
View 1 Replies
View Related
Feb 12, 2014
I have three different forms.
1. form is a Login form where i choose between: AA, HH or FA
After choosing on my first form second form opens.
Now my question - how can i do the following:
Based on the combobox in form 1, my button i form 2 will either open form 3, 4 or 5...
View 1 Replies
View Related
Jul 30, 2013
I would like to set up a picture in the form that changes based on a combobox selection, for example if you select from combo box list "design1", a picture that have a name : design1 will appear as a background to the form ..
View 8 Replies
View Related
Nov 1, 2014
i have 2 tables (clients, frequencies) where in table "clients" i have a column to store ID of "frequencies" table (id, description).
in my form "FClient" i display data stored in table "clients" and i have a combobox that should display the "frequencies" descriptions, but with a frequency selected by default...in fact the one that has its ID stored in table "clients". i'm able to display all frequencies descriptions but i don't know how to easily select and then display, as default, the frequency stored in table "client"
View 3 Replies
View Related
Apr 23, 2014
I have a table [Employees] that has the field [FirstName] and [LastName]. On my form [Jobs], I have a combobox [ComboWho]. The combo box has all of the possible first names. When a first name is picked, it makes the last name fill in a textbox.
In the real version, it is a [LastName] is a lot of information, so it is kept in a memo field. I tried to use cascading combo boxes, but it cuts off my text.
I keep getting it to almost work... I've tried about 5 different methods... DLookUp, subform, etc.
Right now, I'm using this code:
Private Sub ComboWho_Change()
Dim location As String
Me.ComboWho.SetFocus
location = DLookup("LastName", "Employee", "FirstName = '" & Me.ComboWho.SelText & "'")
Me.MyTextBox.SetFocus
Me.MyTextBox.Text = location
End Sub
It has properly filled in the textbox. I thought it was working perfectly, but ran into one snag... We have been using a split form... and it won't let me filter that column (Column ComboWho). I think because it is saving everything as numbers instead of text.
ComboWhoDatabase.accdbI've attached a copy of the simplified database.
View 5 Replies
View Related
Mar 30, 2015
How can I remove an item after being selected from a combobox ?
View 2 Replies
View Related
Jul 11, 2013
I am still trying to get a hang of development in access 2010.
I would like to design a form with a listbox or a combobox which holds all 8 of my reports (a table has all the reports), with a Print and a Preview view buttons. In addition, the user must be able to select if they want to view the report by month, quarter and the year in question.
How do i have a specific report print or previewed based on the value selected in the listbox or combobox and the date criteria.
View 4 Replies
View Related
May 19, 2013
I have a table, Registration, with 8 fields:
inschrijvingsid,name,gemeente,gsm,telefoon,email,a ankomst,gerecht,personen
I have another table, Login with 3 fields : Naamid,name,,status
Then I have a combox that is connected with fldname from the table Login.
In that form I have 8 textboxes:
name,
gemeente,
gsm,
telefoon,
email,
aankomst,
gerecht,
personen
And status.
Now what I can't. I want when I select a record from tblLogin Like for example Daan that I see in the textboxes his info from the tableRegistration.
Also when I change the textbox Status it and click "Verander status" it changes in the database.
View 3 Replies
View Related
Oct 2, 2005
I have a form that is based on a query, on the form there is an option group with two options (show all and show active). This option group is the criteria for the query the form is based on. My hope was to have a requery on the after update of the option group and have it show approptiate records based on that option group.
My query does work if I open it by itself, and the form will show the appropriate records when it is initially opened. However, when I change options in the option group the query runs again but the data in the form is not changed.
I have searched every forum I know of but I have not found out how to make this work. It is like the form is not being refreshed with the new data from the query.
Lastly, this is my first large database and my knowledge of database design is a little like swiss cheese! Is there a way and would it be better to use a filter to do this? I want the user to just click an option or button to show records marked as active only or show all records. By active I mean the yes no field in the table being set to yes.
View 9 Replies
View Related
Jun 28, 2005
Hi guys,
Bit of a problem I'm hoping someone can help with. I have a telephone call logging system. The system is a tabbed form with each tab representing a person's Telephone Call Inbox. As new calls are entered into the database, they appear in each person's inbox until they are marked as dealt with.
This all works fine and there are no problems with the basics of it, but the problem I do have is that after I have split the database into a Back end and a Front end and distributed the Front ends to each user, when a new call is entered it doesn't appear in the persons inbox until they do a requery.
At first I sent the form to requery using the ontimer event, but the problem I have is that after every reqery the form goes back to the first record. A user on the office forum suggested I use the following code:
vCurrent = Me.Bookmark
Me.Requery
Me.Bookmark = vCurrent
But this gives me invalid bookmark errors, so I was then told to add
On Error Resume Next
But this stops the bookmark function working and instead the first record is loaded every 1 minute (as set by my timer).
Can anyone recommend a better way that actually works without invalid bookmark errors?
View 14 Replies
View Related
Jul 15, 2013
I have a form which contains two sub forms. In the first subform I have 4 fields of Cut#, Size, Quantity and Style. Once the cut# is selected, a vba code runs and fill in the rest of fields. In second sub form I have a field of Fabric# (Combo Box) which should be restricted to the Style value on the first sub form. I have a query which contains the Fabric# and Corresponding style and I try to write a vba code to requery once Style value changes.
View 14 Replies
View Related
Jul 15, 2013
I'm using a sub form to display data form a table. The users wanted it display like a spread sheet. In order to get all the data to display on the same page I am trying to break some of the longer feilds out (i.e. comment field) and display them in a list/text box and not in the table with the smaller fields.
Basically what will happen is when a record is selected in the sub form the comment field tied to each record will be displayed below. I've tried a few things but I keep getting errors displayed in my list/text box (#Name?)
View 14 Replies
View Related
Jul 29, 2013
Can I look up and verify data on a "second" form based on a selected record from first (still open) form.
I am trying to allow users to select a User Name from a combo box list and then open "Change Password" form when they select "Change Password" for that selected user name.
My problem is that I can't figure out how to associate and verify the data tied to the user name selected on the previous (Login) form ( I am trying to validate the old password tied to that selected record).
I have the first login form created, and it's working just fine. I also have the change password form created (and it's displaying the user name selected from the first form using:
Code:
Private Sub Form_Load()
With Forms![frmLogin]![cboUserName]
Me.txtPwdChgUserID = .Column(2, .ListIndex)
End With
EndSub
I also have the code written to validate and confirm old password, new password and validate new password (when the save button is clicked). I have yet to update the password with the new password (still trying to figure that out).
Attached zip file has screen shots of the two forms.
View 3 Replies
View Related
Jun 28, 2013
I'm building a workCube reservation system and I've been tasked to have it work kind of like an airplane seat reservation system. I've laid out my form with option buttons representing the location of each available space. (space1, space2, space3...space16)
My desired outcome is to be able to select a date from a calendar popup and have the options buttons react to that date if they have been reserved. (change color and indicate "reserved").I've tried to create the form based on a query which represents the "booked" table.
Tables:
Employee
(k)empID
emplyeeName
Space
(k)spaceID
space
Booked
(k)spaceID
(k)empID
(k)bookdate
Some rules a space can be booked by any ONE employee on any day.How can I get any and all of the option buttons to react if there is a reservation in place on the day indicated by the calendar?
View 4 Replies
View Related
Nov 5, 2013
I want a command button to "Requery" a combobox. the combobox uses a query to determine the records listed (it lists incomplete records). after completing the record, i'd like to hit a command button that will "requery" the combobox so that the recently completed record is no longer listed.
I tried this:
me.nameofcombobox.requery
But the completed record was still listed.
View 3 Replies
View Related
Jun 2, 2014
I am trying to add a combo box into a form and when the Combo Box wizard pops up I only get two choices:
I want combo box to get values from another table or query. I will type in the values I want
I want the third option...
Find a record on my form based on the value I selected in my combo box.
Why am I not getting the third option??
View 1 Replies
View Related
Mar 21, 2014
I have a form frm_GlobalSettings with a combobox cmbDescription that finds a record based on the value selected. The row source type for cmbDescription is Table/query, and the row source is a select statement on the form's underlying table.
I want the user to be able to use cmbDescription to add a new record to the form's underlying table. I currently have
Code:
Private Sub cmbDescription_NotInList(NewData As String, Response As Integer)
Dim strTmp As String
'Get confirmation that this is not just a spelling error.
10 On Error GoTo cmbDescription_NotInList_Error
20 strTmp = "Add '" & NewData & "' as a new global setting?"
[code]....
but when a new value is entered this errors on line 70 with "runtime errror 2118 - you must save the current field before you run the requery action".I've tried various ways around this but can't get it to work.
View 2 Replies
View Related
Jun 17, 2013
I have been using AYS2000 database example from Rogers access library. I have been in the process of modifying to meet my needs. Although I have run into a problem that was prevalent in the original database example. I have attached the original database for your reference.
Problem: At the bottom of the database beside the "New Response" button there are 2 combo boxes that allow you to select the survey and response in which you want to view in the subform. Although when selecting the response the subform does not always update the record in the subform. It would appear that the problem occurs only after a response has been previously selected. I have tried adding additional code to refresh and requery the subform already without any success.
View 3 Replies
View Related
Jun 25, 2013
I have two Tables, "staff data" (staffID, name) and "issues log" (IssueID, StaffID, 20+ fields about individual Issues). StaffIDs are linked together so each employee can have multiple issues..I have (so far) Form1 containing individual Issues that can be filled in, or retrieved one at a time / scrolled through in IssueID order
What I want is a second form, containing a combobox with all StaffIDs (+ names) listed; when a StaffID is selected, a table is loaded containing all Issues for that employee. When any of these is selected, Form1 is loaded
I have created the second form, including the combo that contains both StaffIDs and Names. I can't yet grasp how to show the set of Issues applicable to that employee when I change that combo...If I could have the combo on Form.
View 2 Replies
View Related