I'd like to create a combo box that is not limited to the list of records from a table, but allows the user to add to the table by typing into the combo box. I believe I write this code in the "after Update" event, but I'm not sure of the syntax. Can someone help?
The combo box is simply displaying the records from another table...so the code would add a record.
I have two related tables - one is study information and one is person information. For each study, a person is assigned. On my form, I have a combo box to choose a person to add to a study. This works fine when the person exists already. To add a new person, I have an "add" command button that brings up a form to add a new person to the table. Problem is when I close the form, I'd have to find the person in the combo box to add them to the study. Is there a way to add a "person record" to the person table and when I return to the study form, have that new person already associated with the study? I don't allow users to edit the person info from the study form (the same person may be associated with different studies). Any ideas to help? Thank you.
I would like to add a value that i choose from a combo box to a table by clicking a button after selecting it from the combo box, and i do not know how to do it?
I have lots of combo boxes in my forms that are mostly limit to list as I want the people entering the data to actually add the full details of a client or supplier or whatever instead of just typing the information in over and over again. if the person/client/supplier is not in that list I have a button that will pop up a form so they can add a full new record but I need it so when they add the new record it will show up in the combo box in the intial form once it has been saved and closed without having to also close that initial form and reopen it or manually refreshing it.
right now I am using an if statement on the save button on my popup form that looks at what form is open and if that form is open then it refreshes that form after the save and closes which works fine but adding this to every form and combo box combination is very tedious, so I thought I would ask here, what is the best way to update combo boxes after and new record has been added via another popup form?
error message I am getting when I click on my Duplicate Record button (created through the wizard).
I have two combo boxes on the main form that populates data when the user makes a selection from the combo box. First combo box populates project data and the second combo box populates equipment data. The form is working well with the two combo boxes populating the data into the main table.
Now I would like to add a duplicate record button to copy a record and paste the data as a new record. So, I added a duplicate record button using the wizard and I am receiving the following AfterUpdate error.
Run-time error 3020: Update or CancelUpdate without AddNew or Edit.
This is the code I am using to copy and paste a duplicate record:
Private Sub InputForm_DupRec_Button_Click() On Error GoTo Err_InputForm_DupRec_Click DoCmd.RunCommand acCmdSelectRecord DoCmd.RunCommand acCmdSaveRecord DoCmd.RunCommand acCmdCopy DoCmd.RunCommand acCmdPasteAppend Exit_InputForm_DupRec_Click: Exit Sub Err_InputForm_DupRec_Click: MsgBox Err.Description Resume Exit_InputForm_DupRec_Click
It seems to be duplicating the data from the first combo box, but not the second one where it errors out.
I have 10 combo boxes on a form looking up at the same table (fileld A). I want the user to be able to enter a new value (that's not in the table and therefore neither it is in the combo box) to the 1st combo Box (let's say) and that same value to be automatically added to the table, so when I use the next (2nd one) combo Box, that same value is already in the table.
I need code for the 'On Not In List' event procedure so that users can add a new item to a combo box... its just a simple combo box linked to values in a table any help would be great thanks
I have a bound combo box on a form. The selections alow a subform to refresh limiting records to the bound combo box. I have been on the web a lot looking for a way to enable multi list selection or all on a combo box. None of these have worked for me. The selection combo box is a simple Yes or No. I would like to add all and have it return both types of records.
This is the sytax I have in the row source property for my combo box.
SELECT [Sales Master].[Accounting Comp Flag] FROM [Sales Master] UNION Select "All" FROM [Sales Master] GROUP BY [Sales Master].[Accounting Comp Flag];
This code allows the combo box to have an all selection but it does not retrieve any records.
If someone can find my mistake that would be great! Thanks!
I have a data entry screen that requires the user to select a assessment type from a combo box that gets its values from a separate table. So far i have 3 Assessment types, these are Quality, Manufacturing and Technical.
If the assessment type they want is not is the combo box list. I want them to be able to type in the assessement type in the combo box and have it saved to the assessment type list so that in future it will be availible directly from the combo box.
Any ideas on how i can do this as it's giving me a head ache....
I am extremely new to access. I am trying to add a combo box to one of my columns. Basically i have about ten columns of which a couple of them I want to have combo boxes so that the information that is in each of these columns is standardized. Currently all I have is my ten columns with headings set out.
I've created a simple form with a combo box, using wizard, and I create this code. for to add items when isnotinlist event. After requery, old data are changed to primary id numbers.
E.g.
Nametxt, id=1 Surnamext, id=2 Agetxt id =3
When i add a new item, the first item nametxt, converts to 1. This is the id. Here is the code
Dim cnn1 As ADODB.Connection Set cnn1 = CurrentProject.Connection Dim rs As New ADODB.Recordset rs.ActiveConnection = cnn1 rs.Open " SELECT * from affectiontbl ", cnn1, adOpenDynamic, adLockPessimistic
Does anyone know of a way to allow a user to add further info to another field on the same record that's created by a combo box that is using the Not In List method?
Dim strsql As String Dim i As Integer Dim Msg As String
'Exit this sub if the combo box is cleared If NewData = "" Then Exit Sub
Msg = "'" & NewData & "' is not in the list of Callers names." & vbCr & vbCr Msg = Msg & "Do you want to add it?"
i = MsgBox(Msg, vbQuestion + vbYesNo, "Unknown Caller...") If i = vbYes Then strsql = "Insert Into tblCallersName([CallersName]) values ('" & NewData & "')" CurrentDb.Execute strsql, dbFailOnError Response = acDataErrAdded Else Response = acDataErrContinue End If
I need to log a persons name & phone number without having to re enter it again the next time.
To log the name I use a combo box that lists all the previously added names & it also allows you to add further details if the name does not already exist
I now need to work out how to also add the phone number without having to manually go into the names table to add it in.
If anyone understands what I'm talking about then you're halfway there :D
I have a Combo Box that places the Address into the given Address field. How can I have it place the second and third cloumns, from the Combo Box into the next two adjacent fields on the Form (Last Name & First Name)? Please describe in detail, not just code, but where a how it goes. I am new at this thing.
I have an existing FORM called Evaluations where you can select a trainer and a trainee from two different combo boxes. Once a name is selected from both of the combo boxes I click on an assign button and I want it to record those two names selected into my evaluations table in the Trainer_Name and Trainee_Name columns.
I'm working on a database where users enter an assignment into a datasheet form. Assignments are selected from a combo box that has values stored in a table. After choosing the assignment, the user adds the date it was completed. After this is done, I would like the "Next Due" column to update. Each assignment will have a different next due date, such as one year from the completion date, six months, etc. I don't know how to add different values depending on the combo box selection.
I have a form that currently uses a "catch all" table for listing available equipment to choose from for an equipment field. I call it tblEquipment. What I want to do is to make it so when I type a name in (1 of 35) in one field of the current record, the record source for the equipment field immediately looks at a different table that has equipment available only for that name. To do this I plan on making 35 different tables with limited data originally found in tblEquipment. I would call these tblEquipment1, tblEquipment2, etc. I do not use a sub form, nor do I want to.
So my questions are:
1) can this be done 2)If it can be done, how can I do it?
I have a search form with unbound combo boxes that uses the combo box values as criteria for a query. The Row Source of cboCategory is based on the query:
SELECT Categories.ID, Categories.Category FROM Categories ORDER BY Categories.Category;
When I start the form and I don't select a value for the cboCategory combo box, the query just returns all the values. This is great. The problem is that if I make a selection in the combo box, I have no way of reverting it back to that initial value that would make the query return all categories - if I erase the combo box the query returns nothing. So I have to close the form and reopen it.
I tried adding an "All" value to the combobox like so:
SELECT Categories.ID, Categories.Category FROM Categories UNION Select Null as AllChoice , "(All)" as Bogus From Categories ORDER BY Categories.Category;
but it does not seem to work. It just returns nothing instead of all the categories. How can I add a value of "All" to the combo box that will return all of the categories?
It's been a while since I've asked a question here, but I can't seem to figure this problem out.
I am setting up a form using data from 4 different tables, all related, and I can't figure out how to add fields that I didn't initially add during the wizard set-up. I used the wizard because it's easier for me to do that and then go in and make the changes I want to make.
When I get data from just one table, all of the available fields from that table are in the "Field List" no matter what fields I chose to include in the wizard process. That's good. But when I get data from more than one table, only the fields I initially chose in the Wizard process are showing up in the field list. I can't figure out how to add a new and different field from one of those tables.
The way I "solved" this problem the first time was to start over, creating my form from scratch--but now that I've done a lot of work, it just occurred to me that I will need to add 2 more fields. (I actually don't even have those fields in a table yet, but I will add them later.) So, this will be an ongoing problem. Since this form will get much use, by several people, I don't want to have to re-create it every time I want to change something.
So, is this possible? How can I add another field?
Also, while I am at it... A combo box was working beautifully to look up specific records when I was gathering information from only one table. It isn't working anymore.
I am creating a form in access. In the form there is a combobox in which I am adding items using RowSourceType as Value list and Row Source as Male;Female. What I require is whether there is some way so that when I select Male from combo box M is stored in database and with Female F is stored. I know how to achieve this with RowSourceType as Table/Query but not with RowSourceType as Value List.
I stumbled on to a Dynamic Multi Search form on this site and have been tailoring it to my organization's directory of contacts. Everything was going good until I was asked to include a search by groups to which each individual may belong. The data in the table is contained in Yes/No check boxes for around 30 different groups. I am hoping to add a combo box to the Dynamic Search as a means to pull up individuals in any 1 category. Below are two attempts at what I thought might work, however, neither performs any filtering.
Code: Private Sub Groupbox_Change() Dim db As Database Dim qdf As QueryDef Dim strSQL As String Set db = CurrentDb Set qdf = db.QueryDefs("qryGroup")
I have a combo box that is not tied to any control but uses a value list as the row source in the data tab. My question is... it currently holds two names but I am wanting to add a third but when I do the third name does not appear like the first two in the form view. The first two show:
Last Name, First Name, employee #
And the third shows Last Name, First Name
employee #
And on the third entry... the first name shows where the employee # should be
I am adding a combo box to a form with data sourced from a table. Everything seems ok but when I select an option from the combo list and move to the next record the selection is repeated there also. How do I get to select a different option in the next record?
I am using Access 2010 (self taught and continuing to learn each time I get asked for a new report). I have created a query based on the data being selected from two combo boxes on a form, ie start date and end date. The report works as it should but I want to be able to automatically use the dates in the report heading. For instance, Summary Report from xxxxx to xxxxx, where xxxxx is the start and end dates that the user entered into the two combo boxes.
The date field on my query reads Between [forms]![F - CboReportDates]![Start Date] And [forms]![F - CboReportDates]![EndDate]