Adding A Record Through Combo Box

Mar 13, 2013

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?

View Replies


ADVERTISEMENT

Adding A Record For A Combo Box

Mar 4, 2005

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.

View 2 Replies View Related

Adding A Record From A Combo Box

Jan 15, 2005

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.

Thanks much!

View 7 Replies View Related

Modules & VBA :: Update Combo Box After Adding A New Record

Mar 12, 2015

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?

View 2 Replies View Related

Forms :: Error On 2nd Combo When Adding A Duplicate Record?

Jun 7, 2015

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.

View 1 Replies View Related

Forms :: Open A Form For Adding Child Record Related To Highlighted Record In Subform

Oct 2, 2013

Is it possible to open a form to add a child record related to the highlighted record in the subform?

View 2 Replies View Related

Adding New Value To Combo Box

May 31, 2007

hello,

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.

How can I do this??

Thank you very much

View 1 Replies View Related

Adding A New Value To A Combo Box

Dec 8, 2004

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

View 9 Replies View Related

Adding (All) To A Bound Combo Box

May 24, 2005

Hello,

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!

View 7 Replies View Related

Adding A Combo Box To Query

Aug 2, 2006

Hi,

I'm trying to add a combo box to my query so when I select the item from the combo box it executes my query. I don't know where to begin... Any help??

View 7 Replies View Related

Adding Records To A Combo Box

May 17, 2005

Hi all,

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....

Many thanks in advance.

El Cid

View 8 Replies View Related

Adding Combo Box To One Of Columns

Sep 26, 2011

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.

View 3 Replies View Related

Adding Item To Combo Box With VBA

Apr 1, 2012

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

[Code] ....

View 12 Replies View Related

Combo Box - Adding Further Info - Not In List

Dec 6, 2006

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

See attached db



thanks

View 2 Replies View Related

Adding Items To Combo Boxes

Sep 4, 2005

Hey Guy and Ladies,

In one database (Originally an Orders Database created by wizards)

This code to add items to a drop down list in the “orders details subform” works fine.


Private Sub ProductID_DblClick(Cancel As Integer)
On Error GoTo Err_ProductID_DblClick
Dim lngProductID As Long

If IsNull(Me![ProductID]) Then
Me![ProductID].Text = ""
Else
lngProductID = Me![ProductID]
Me![ProductID] = Null
End If
DoCmd.OpenForm "Products", , , , , acDialog, "GotoNew"
Me!ProductID.Requery
If lngProductID <> 0 Then Me![ProductID] = lngProductID

Exit_ProductID_DblClick:
Exit Sub

Err_ProductID_DblClick:
MsgBox Err.Description
Resume Exit_ProductID_DblClick
End Sub

When the same code runs in my new database

Private Sub OptionID_DblClick(Cancel As Integer)
On Error GoTo Err_OptionID_DblClick
Dim lngOptionID As Long

If IsNull(Me![OptionID]) Then
Me![OptionID].Text = ""
Else
lngOptionID = Me![OptionID]
Me![OptionID] = Null
End If
DoCmd.OpenForm "Products", , , , , acDialog, "GotoNew"
Me!OptionID.Requery
If lngOptionID <> 0 Then Me![OptionID] = lngOptionID

Exit_OptionID_DblClick:
Exit Sub

Err_OptionID_DblClick:
MsgBox Err.Description
Resume Exit_OptionID_DblClick
End Sub

I get the error message

“You tried to assign the Null value to a variable that is not a Variant date type”

Any suggestions?

Also if anyone knows a better way to add items to a list box “On the Fly” I would really appreciate it.

It would be nice if you could type in the value and it would automatically add it to the list for future use.

Thanks for all of your help,
Joe

View 7 Replies View Related

Adding Combo Data To Fields

Mar 15, 2006

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.

View 1 Replies View Related

Adding Combo Box Data To A Table

Jul 28, 2005

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.

How do I do that??? Please help??

Thanks

View 2 Replies View Related

Adding Different Due Date For Different Combo Box Selections

Apr 9, 2015

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.

View 5 Replies View Related

Forms :: Change Record Source Of Combo Box On Form Based On Another Combo Box

Mar 31, 2014

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?

View 3 Replies View Related

Adding All Selection To A Combo Box On Search Form

Jun 5, 2014

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?

View 8 Replies View Related

Adding A Field To A Form Using Multiple Tables (And A Combo Box)

Jun 15, 2006

Hello!

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.

Thanks in advance!

-Siena

View 8 Replies View Related

Forms :: Adding Key Value Pair In Combo Box Using RowSourceType As Value List

Jun 20, 2013

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.

View 1 Replies View Related

Modules & VBA :: Adding Combo Box To Dynamic Multi Search

Jul 27, 2015

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")

[code]....

View 6 Replies View Related

Forms :: Combo Box Tied To Any Control - Adding Third Entry?

Jul 17, 2013

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

View 6 Replies View Related

Forms :: Adding A Combo Box To A Form With Data Sourced From A Table

Nov 6, 2014

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?

View 1 Replies View Related

Reports :: Adding Data To Report That Was Selected Using Combo Boxes?

Jan 21, 2015

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]

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved