MainForm ComboBox Populates All Records In Query... Why???
Mar 15, 2005
All:
Currently have a Form / SubForm arrangement combining qryItemAllowedAndUnschedlued with tblInventoryItem.
The main form is based on the query and the subform on the table.
My effort is to create cascading combo boxes where a selection in the main form populates a "conditional" list in the subform.
More specifically, where the user selects ItemClass in the main form, I am attempting to populate a list of ItemCategories in the subform based on the selected ItemClass.
I have reviewed and continue to study existing posts on Cascading Combo Boxes and Form / Subform arrangements. However I currently have a question I do not see covered...
When I select my ItemClass it is populating throughout the query and not solely in the current record displayed.
Does anyone know why this may be?
I fear the answer is a simple setting that my current experience is making difficult to isolate. I trust it will present itself with patience, but in the interim more experienced feedback is welcome!
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?"
I have a form with a combo box, whose afterupdate code is:
Private Sub CustomerName_AfterUpdate()
Dim rs As Recordset Dim person As String {This will contain the SQL Statement} person = "select people.department from people where people.name='" &
CustomerName.Value & "'" Set rs = CurrentDb.OpenRecordset(person) {Now the following are combo/text boxes that are populated} Department.Value = rs("department") InputDate = Date InputTime = Time
My code works: when you select something in CustomerName combo box, the other
boxes in the record get populated with data. The problem is that ALL the records in the
form get populated with this data as well... I want the records to be independent of each other - that each record will be filled
I have a form with a combo box, whose afterupdate code is:
Private Sub CustomerName_AfterUpdate()
Dim rs As Recordset Dim person As String {This will contain the SQL Statement} person = "select people.department from people where people.name='" & CustomerName.Value & "'" Set rs = CurrentDb.OpenRecordset(person) {Now the following are combo/text boxes that are populated} Department.Value = rs("department") InputDate = Date InputTime = Time
My code works: when you select something in CustomerName combo box, the other boxes in the record get populated with data. The problem is that ALL the records in the form get populated with this data as well... I want the records to be independent of each other - that each record will be filled separately.
Simple question but I've been stuck for a looong time.
So what I want to do:
1. enter a value into a text box (Home_Tel) in a form (frmStudentClass) 2. which runs a query (qryNameTel) 3. and return the results to a combo box (Student_Name) on the same form.
The same Home_Tel may have several Student_Name results.
-I have entered [Forms]![frmStudentClass]![Home Tel] for the criteria in the query - However I can't get the results to turn up on the combo box - I have the following:
Private Sub Home_Tel_AfterUpdate() ' run query DoCmd.OpenQuery "qryNameTel"
Me.Student_Name.Requery
End Sub
Any ideas?
Or is there an easier way to tackle the problem?
Home_Tel and Student_Name are from the same tables. I have created a query just for Home_Tel and Student_Name
I have a query that populates a report linked to a mail merge. There is an IFF statement in it that checks to see if a condition is meet. If that condition is meet some standard text results. Is it possible to put a disclaimer with the standard text.For example,
Code: IIF ([Results]="Negative","Nothing detected" (the disclamer would go here)
I am not certain the correct syntax to use to insert "not all regions were tested".
I would like my form field to populate based on what the user selects from 2 combo boxes I have. I have a table set up with Region, Position, and Name. I would like when the user selects for example Eastern for the region and President for the position that John Smith would auto populate in the form field. Is this possible and if so, how can I get this to work?
What is the best way to get a field to automatically populate on a form when the user select criteria from 2 combo boxes. For example in cbo1 the user select Eastern and cbo2 the user selects Regional President. How can I get in a seperate field the name of the Eastern Regional President to populate?
I have a simple question with an answer that hides relentlessly from me. I have a combo box on the main form called cboProjects. I also have a subform called SubProjectsDetails. I'm trying to get it to where if a user selects a project from the combo box, the details show up in the subform. The relationships are good and working, and if I add a Find Record button on the form, that works as well. I just don't know the code to dynamically populate the subform with combo box values.
I want to populate the Class Code field based on the class they select. The code works fine except that the Class Code field does not update until after I tab past it. There is a field in between Classes and Class Code so I have to tab 3 times before the textbox populates. I expected the textbox to populate immediately after I selected the class. I also tried putting the code in the On Click event of the combobox but that didn't work either.
If I just keep clicking on different classes I'd like the class code to change each time without having to tab to another field. Is that possible? What am I doing wrong?
When I enter a combo box on a form, whatever I choose from the combo box, it populates everything. If I go to a different row to change it, it changes them all. How do I get that to stop? And why does it do that?
I've designed a form to register the parametros of a world-wide statistic report In the form I have a combobox to select by pais, but additionally I need the option 'ALL' for to inform about all countries
How I can include the option ALL in the combobox ?
Hello everyone. It has been many years since I played with this stuff and I probably wouldn't be now, if not for an emergency. I know there is probably an example here that all ready explains what I need, but honestly, I am not real familiar with the terms and wouldn't know where to begin looking for it.
I am old and don't intend to make a career out of this, I just need to fix a database. We had a bookkeeper at our small business who, for years, maintained our mailing list. It was her own design, though she knew nothing about it and learned as she went along. We never interfered because she did her job flawlessly in her own little, confussing round-a-bout way. She is gone now and we have to make heads or tails of this. We decided the quickest and easiest way was to blow the old db away, use as much of the basic fields that we could sacrifice and start over. It's just a simple mailing list, but it contains over 9000 records.
Her method of entering records was from the table view. Yep, starting a new line at the bottom of the table and then entering the 94 fields of information that applied to the new record. I have created a form today that does this now and simplifies this process. Her method of preventing multiple records, was to scroll down the table and see if she had already entered the record previously. This is my question.
My first approach to resolving this issue in my new form, was to create a ComboBox on the form to do a lookup using Last and FirstName. Due to the fact that this ComboBox will need additional fine tuning that I don't understand, when I use it, it does auto-complete the last name "Anderson" as I type it and it highlights the first "Anderson" record in the db, but It doesn't do any sorts in this same ComboBox to bring the rest of the "Anderson" records to the top so I can then check for a matching FirstName. I'm sure this requires changes in the property of the ComboBox that I don't understand. Or, maybe I shouldn't even be using the ComboBox.
Actually, I would bet there is a way that I can alter my table so that it would not allow me to put in a duplicate record and therefore, eliminating the need to even look anything up.
Any ideas or direction with this would be greatly appreciated. Since I am only the person creating this and not the person(s) that will actually be using it, I should find a method for this that will be simple for anyone adding records. Hopefully, in a day or so, I can be done with this and get back to my real job here as a mechanic, not a programmer. :eek:
I use Access 2003 and saw Ken Higg's sample database to filter records in a form using a combobox. I managed to replicate his settings and wondered about an extension to the principle, but I don't know if it's possible.
In the sample, a value is selected using a combobox and all matching records are filtered so it's possible to scroll through them. Is it possible to have a second (or more) combobox on the form so it is possible to filter on one or another criterion? This would mean one combobox filling the other one and I realise that the one that Ken provided is unbound.
The reason that I'd like to do this is, for instance, if there are records with Surname, 1st, 2nd and 3rd lines of the Address and Postcode, I may wish to filter records by entering the Surname or Postcode. Each of these fields would have to be displayed in a combobox. As the sample is set up at present, only one of the Surname or Postcode has to be selected via the combobox and the other is a textbox.
It may be that what I'd like to do isn't possible - or someone may have come up with some other idea. I'd prefer to have the search/filtering on the form, rather than using the buttons on the Form View toolbar.
I have an unbound form with a combo box and a bound subform on it.
I am using the combo box to get a value to filter (and display) records in the subform.
My code is:
Private Sub cboSessions_AfterUpdate() On Error GoTo cboSessions_AfterUpdate_Err Me.SSubform.Visible = True 'subform was initially invisible Me.SSubform.Form.FilterOn = True Me.SSubform.Form.Filter = "[LinkID]=" & Me.cboSessions Me.SSubform.Form.Requery cboSessions_AfterUpdate_Exit: Exit Sub cboSessions_AfterUpdate_Err: MsgBox Err.Description, vbCritical, "PROGRAM ERROR" Resume cboSessions_AfterUpdate_Exit End Sub
The subform is initially invisible to stop it showing all records.
This works fine AFTER the first selection(!) - the first Update of the Combo Box just doesn't filter the subform??
I have tried putting code in the main form's On Load Event - allocating a value to the Combo Box and running cboSessions_AfterUpdate but that does not work either.
I think my question is fairly simple - fingers crossed.
I want to create a field that, whenever a record is added, it auto-adds the date & time the record was created. I'd call it Book_Date_Added, or something like that. I tried snooping around the Default Value options but couldn't figure it out.
The table exists and it already has some records, so I'd need to know how to add this field rather than how to create it when I create a table (although that would be helpful too, if it's somehow different).
How do I implement a db with a MainForm and several ChildForms (which contain subforms) and each form sourcing data from its own table (MainForm-MainTable, ChildForm1-ChildTable1, CF2-Ct2,... SubForm1-SubTable1,...). There are buttons in the MainForm to navigate to the ChildForms. How to link, relate or make the db work, so that the every record from the MainTable has an related record in the ChildTable?
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.
I have a very simple 2010 Access database with only one table which contains a few fields (username, email, phone....)
I have a combobox with unbound controls to search/find users (by the lastname field). The combobox is in the header section which populates the fields (controls?) in subform below.
I have a delete button with some VBA code which allows the user to delete the currently displayed record however when the form refreshes, I end up with two issues:
1: I see #deleted# in the combobox dropdown until the dbase is closed/reopened (it's only typically used by one person at a time.) Compact/Repair doesn't seem necessary, especially since i think it's pretty difficult to do this programatically (?)
2: There are blank rows in the combobox dropdown from where the data used to reside after deleting the record.
I haven't been able to figure out how to remove those blank rows and refresh the combobox to display the remaining records (with the blank rows removed). So I have dozens of blank rows. Me.Requery doesn't seem to work.
My assumption is that the blank rows exist because I'm deleting the content from the combobox's initial creation?
Is there a better way to allow user's to see the list of user's and then be able to select that record and delete it?
If I use a simple search box on a form where people have to type a (last name for example), if it's spelled incorrectly, then nothing would be found.
I have a form called “frm_TrainingLog” based on “TrainingLog” table. This form is continuous and tabular – I need to have it this way. In the header of this form I’ve created a listbox called “QuickSearch” which displays staff details i.e. StaffID, Name etc.
The mainform and the listbox are linked using the following code:
The above code does partially work and selects the right record in the mainform but it doesn’t filter out rest of the records which are not equivalent to selected StaffID from the listbox.
I have a mainform, with a popupform, on which I want to select a record/post to work with on the mainform. I have managed to select the actual post on the popup, but i dont know how to make the mainform navigate to that form.
How do I easiest accomplish to make the mainform navigate to the record I've selected on the popupform?
I have a ComboBox which looks up the records in a query. The query contains the names of current employees. The table upon which the query is based lists Employees and their start date and finish date. The Query is based on finish date being Null (ie they're still working here).
In the main form which details tasks, I would like the ComboBox to just list current employees (which it does as it's based on the query) but when an employee leaves, their name is deleted from all previous records.
Is there a way to keep the ComboBox options limited to current staff, while also keeping the names of previous employees in the form?
I checked the table which the form is based on and it still has the values, so I'd like to show in the form too as that's what people will be working on.
I am creating a data base to handle access requests to a building. All has gone well so far and ive built tables, reports, forms and used queries. However now im trying to get abit more clever and ive hit a bump of understanding/apprach.
Whilst a ninja in Excel, im still working out which is the pointy end in Access.
The database holds all details of access requests inc: Company attending, Individual attending, Access Levels and Period of attendance. This is all done with forms for the users and functions beautifully (ish).
I can run reports on this data, based on queries (there is much more included than above but you get the idea) and generate all the reports I need.
What I wanted to do was add, following attendance to the site, the card details of the AC card they were given for the visit.
My intention was to have a form with three variables: a combobox that would let you select the individuals company and two text boxes to select a date range in. Leaving just say three or four people from that company on that day rather than everyone who had ever atteneded to sort through and add the card details.
The combo box comes from another query that gave me individual company names from the main table.
I thought a date query (as in placing a more than <> or less than criteria vs textbox value on form in the query build section) could be added but I hadnt got that far.
It seems what I have done works backwards (oops), I can adjust the query from the form but get every record in the table on the form to click through to add card details, which will be abit rubbish when i have 1000's of requests building up in the history.