2 Combo Boxes To Add New Record

Sep 19, 2006

i have 2 combo boxes on a form and a button to add a new record in a table. i am trying to add code so that if either of the boxes is 'null' that an error message displays and the code ends so that a partial record isnt entered into the table. i think the solution is adding a line somewhere to my code but im not sure where. Here is the code i have for just one of the boxes to get it working correctly:

Private Sub Command31_Click()
On Error GoTo Err_Command31_Click
If IsNull(Me.Combo14) Then
MsgBox ("invalid selection made")
End If

DoCmd.GoToRecord , , acNewRec

Exit_Command31_Click:
Exit Sub

Err_Command31_Click:
MsgBox Err.Description
Resume Exit_Command31_Click

End Sub

This code gives me the error message, ive tried putting in end sub/exit sub before and after the 'end if' but each time the record is added to the table.
Can someone tell me how to end the procedure after the if statement if its condition is true?

View Replies


ADVERTISEMENT

What's The Best Way To Add A Record To A Normalized Database Utilizing Combo Boxes?

Jan 30, 2006

I have four tables with unique records as shown below. I'd like to add a record for a new item to the database by selecting the values from combo boxes for Supplier, Item and Unit. If the values do not exist the user would then type in a new value. SuppliersItemCode and Cost would always be new values. What's the best way to go about this? I am unsure how to add a record to a normalized database where you sometimes have to use / reference existing unique values in multiple tables via foreign keys for the new record.

The logic of the form would be:

1. Select existing or add new Supplier.
2. Select existing or add new Item.
3. Select existing or add new Unit.
4. Enter new SuppliersItemCode
5. Enter Cost

Suppliers
---------
SupplierID (primary key)
Supplier (indexed unique)

Items
------
ItemID (primary)
Item (indexed unique)

Units
-----
UnitID (primary key)
Unit (indexed unique

SuppliersCostsAndCodes
-----------------------
SuppliersItemCostCode (primary key)
Cost
ItemID (foreign key)
UnitID (foreign key)
SupplierID (foreign key)

Any advice or assistance is greatly appreciated, thank you.

View 5 Replies View Related

Forms :: Editing A Record - Combo Boxes Do Not Populate?

May 30, 2013

I have a data entry form that is also used for editing exsisting records, upon the opening of a record the form populates with all the data of the record apart from what is previously selected in combo boxes, so I need to find a way to re-populate those comboboxes?

View 1 Replies View Related

Navigate To A Record Based On Series Of Combo Boxes And Button

May 10, 2012

I'm trying to navigate to a record based on a series of combo boxes and a button. The user goes through the combo boxes, first picking a (let's say) Store, then Aisle, then Item. The Item combo box stores the Item's unique ID as its bound column.My code is as follows:

Code:
Private Sub NavigateButton_Click()
Me.Recordset.Clone.FindFirst "[ItemID] = " & Me![ItemComboBox]
Me.Bookmark = Me.Recordset.Clone.Bookmark '(<-- Don't actually have this in yet, but I will need it)
End Sub

The ItemID field in the ItemTable table is an Autonumber Long Integer. Why am I getting the error "Engine does not recognize 'ItemID' as a valid field name or expression"?There are no references within the form to the ItemID directly (no text boxes, hidden fields etc).

View 1 Replies View Related

Cascading Combo Boxes - Interact And Record Selections Made In New Records Within Destination Table

Sep 12, 2012

I am trying to get a series of combo boxes to interact and record the selections made in new records within a destination table. Here is situation with respect to the tables involved:

1 table lists the names/acronyms of various research facilities and the branch to which they belong (acronym is PK)
1 table lists Financial Points of Contact for each facility (acronym is FK to relate to earlier table)
1 table lists Technical Points of Contact for each facility (acronym is FK to relate to Facility table)
1 table lists program participants and the branch they belong to (Branch in FK to relate to Facility table)

I am trying to create a form that allows me to set the participant and, from this selection, restricts the facility choices in the Facility combo box to those that fall within the branch to which the participant is assigned. I think the next step is pretty obvious too. Once the facility is selected I have combo boxes that would only display those Financial and Technical PoCs assigned to that facility.

I have watched the 4 Data Pig tutorials and I can easily make functional cascading combo boxes as long as they only refer to the look up tables. I generated perfectly functioning cascading combo boxes on a test form. How do I generate combo boxes that will then store the info selected in my destination table? Whenever I try to set a Control Source it disrupts the functioning of the queries.

View 4 Replies View Related

General :: Auto Populated Text Boxes To Display Rows From Combo Boxes

Jan 25, 2015

I have strange issue when creating auto populated text boxes which displays rows from combo boxes.

In one database auto populates works with simple text box Control Source edit "=[ComboName].[Column](NumberOfColumn)".

Somehow same method doesn't wotk in different database: here one time I have to insert VBA code at On change Event:

Me.TextBoxName = Me.ComboName.Column(NumberOfColumn)

And other time it wont work with On change but only with After Update Event (code is same).

Another thing this morning happens was that when I tried to add new record trough form where combo box and tex boxes are located, MS Office suddenly stopped working after selecting combo box selection (with message Microsoft Office has Stopped Working). It is 2013 version.

I got it work after deleting and re-inserting VBA code to autopopulate text box at After Update Event.

View 3 Replies View Related

Forms :: Database With 3 Tables - Linking Combo Boxes And Text Boxes

Jul 29, 2015

I currently have 3 tables within a database with student details of three different classes. I need to create a user form that has a dropdown box which I can select a student from one of these tables with a number of text boxes below which brings up all the students details, then once the student has been selected and the correct details are shown then I need to create a button which allows me to move that student from one table to another.

View 4 Replies View Related

Queries :: Multiple Combo Boxes And Text Boxes On A Search Form

Mar 24, 2014

I'm trying to build an database for aircraft operators. I've got the basic tables structure and relationships but I'm stuck on building an search form to filter records by user input.I've got following controls on my form (unbound):

1. AircraftType (combo box) from tblAircrafts
2. CompanyName (combo box) from tblListOfAircraftsOperators
3. TeailNumber (text box) from tblAircraftOperators
4. AirportNameSearch (combo box) from tblAirports
5. PassengersNumber (text box) from tblAircraftOperators
6. ManufactureYear (text box) from tblAircraftOperators
7. SourceSearch (combo box) from tblInfoSource
8. CountrySearch (combo box) from tblCountry
9. CategorySearch (combo box) from tblAircraftCategory
10. EamilToOperator (text box) from tblAircraftOperators
11. InteriorPhoto (Bound object frame) from tblAircraftOperators
12. ExteriorPhot (bound object frame) from AircraftOperators

I need to enable users to search for aircrafts based on those criteria. As I mentioned I'm new to Access and I don't have any advanced coding skills. I have a query build to perform the search and this is the code I've managed to write so far:

SELECT AircraftOperators.RegistrationNumber, AircraftOperators.PassengersNumber, AircraftOperators.ManufactureYear, AircraftOperators.EmailToOperator, AircraftOperators.ExteriorPhoto, AircraftOperators.InteriorPhoto, tblListOfAircraftOperators.OpratorName, tblAircrafts.AircraftType
FROM tblAircrafts INNER JOIN (tblAirports INNER JOIN (AircraftOperators INNER JOIN tblListOfAircraftOperators ON AircraftOperators.CompanyName =

[code]....

View 2 Replies View Related

Queries :: Query By Form With Check Boxes / Combo Boxes Not Working

Mar 25, 2013

Attached I have a database that I've been working on which has a form called "frmCriteriaSearch". It is based off of the qryCriteriaListBoxUpdate query. I am trying to get the listbox in the second tab of the results section to work. It queries fine for the checkboxes, but I cannot get the comboboxes to affect the query (unless a checkbox has already been selected)

View 6 Replies View Related

Forms :: Changing Multiple Text Boxes To Combo Boxes?

Mar 14, 2014

there is a way to convert multiple text boxes to combo boxes all at once, rather than right clicking on them one at a time, and selecting Change to.

I have a form with about 50 fields and most of them need to be converted to combo boxes. I'd always done it manually one at a time up to this point, but I'm trying to build up my learning and look for smarter ways to do things.

View 4 Replies View Related

Forms :: Search Form Using Both Combo Boxes And Check Boxes

Jun 5, 2014

I am trying to make a search option in my form header. Right now I have two unbound combo boxes (CboAccountsfilter and cboCourseName) that I can use to filter my records. Currently, I can use the drop down for CboAccountsfilter and a list of accounts will appear. When I select one, the corresponding Course Names will appear in cboCourseName. This works fine...Code below. I would like to take the filtering a step farther and add checkboxes to filter the data. I my form, there currently exist several check boxes (yes/no)...(Priority, Rep Top Target, Manager Top Target, ect). I would like to have the option to use a check box to filter. I.E if I had a checkbox in my header called PriorityFilter, if checked it would only bring up those records that met the two combo boxes criteria and was a priority.

Below is the code I have so far...it doesnt have anything for the checkbox because I am at a lost of how to get started.

Private Sub CboAccountsfilter_Change()
Me.Requery
Me.cboCourseName.Requery
Me.Check178.Requery
End Sub

[code]...

View 1 Replies View Related

Clearing Text Boxes/combo Boxes?

Feb 24, 2005

Another quick request:

What would the code be for a button which clears the contents of a text box or a combo box on a form?

Many thanks,

Paul.

View 2 Replies View Related

Combo Boxes / Text Boxes

Apr 29, 2005

Hi guys, I have a related databes with about 20 tables.

My main table stores the data linking with most of the other tables. This main table stores football match records with player line ups. Initially I had a problem linking the 11 player fields in the main table to the player table, Icould only do it with 1, so someone at work suggested to link it using the lookup function. This worked brilliantly. However, now I am designing a GUI with forms but the forms have combo boxes where the lookup function was used and when i change these to text boxes, the players names are replaced with their ID numbers.

Is there any way of creating the form without the unsightly combo boxes, as they won't be needed, the GUI will be read-only. I look forward to your help!!

View 2 Replies View Related

Combo Boxes And Text Boxes

Jul 12, 2006

I have a table that has client names and addresses. I have designed a form to be able to invoice these clients and everything is fine however what I'd like to do is have the address of the client appear automatically.

I have set the client names in a combo box and would like their address to appear in either a text box or sunken label automatically from the table. Is this possible and how do I do it.

Please keep in mind that I've done basic programming so please be kind to this newbie :D

View 4 Replies View Related

List Boxes And Combo Boxes

Feb 28, 2007

Hi everyone,
I have been making progress with customizing a
MS Access program, but one major problem is that
I have been trying to make a List Box or Combo Box
that I can use to enter data in the TABLE, but I
find that I get a pull-down list that has the list of
values from only the parameter that is primary key.
More specifically, the program is set up as follows:
I have two tables in this program: One that is called
"invoices" and one that is called "items". In both of
these tables, there is one common parameter, which
is "Item Number". Item number is the primary key,
and I used the "relationships" function to tie this
parameter to itself between the two tables.
I was successful in setting up a list-box for the
"Item Number", but when I try to set up a list-box
for another parameter that is supposed to display
a person's initials, the pull-down list displays the list
of item numbers instead of the list of people's initials.
In fact, I don't know if there is an extra step I need to
take so that the database stores a list of people's initials.
Instead, I just fill in the initials in the field for each
record for which the "Item Number" is the primary key.
How can I get the list-box to pull down a selection of
different people's initials, or in other words how can I get
all the people's initials to be stored so that the list of
initials can be looked up. Just so you know, I have tried
different choices of entries in the "Lookup" tab in the
Design mode of Tables, including Display Control,
Row Source Type, Row Source, and Bound Column,
but the outcome is that the only parameter that I
get get in the pull-down list is the primary key, which
is Item Number.
I appreciate any help you can offer in explaining how
to correct this.
On a separate note, one of the parameters is "Date", and
on the reports, I'm trying to figure out how to filter a
specific date range so that I can limit each report to a
specific month. Please advise me on this procedure as well.
Thanks.

View 7 Replies View Related

Forms :: Populate Combo Boxes With Values Depending On Selected Value In Previous Combo Box

Aug 5, 2013

I have several comboboxes (6) on my form.How to populate these comboboxes with values depending on selected value in previous combobox.

Example.Lets say that you select value "Audi" in combobox 1, then available values in combobox 2 should be "A4","A6","TT" etc. and if you selected "BMW" in combobox 1, then available values in combobox 2 should be "3-series", "5-series" etc...

View 1 Replies View Related

Combo Boxes

Apr 13, 2006

Hi
I have a combo box and its row source is a query that selects distinct values from a column in a table

However i would also like the user to be able to select nothing/null value from the combo box. How do i do this.

Thanks

View 1 Replies View Related

Combo Boxes

Jun 27, 2007

What is a combo box and how do I make one?

View 2 Replies View Related

Combo Boxes

Nov 20, 2005

I have created a query to simply bring up various parameters asking questions which then give back the results that are correct! i am wondering if it is possible so that when the parameter boxes display on the screen, for you to be able to select the answer from a combo box list (within the parameter box) instead of typing them in???

Cheers

View 1 Replies View Related

Combo Boxes

Feb 8, 2005

hi
I have a cascading combo box on a form where by you can first select a supplier of a part and then a part from that supplier. (Attached is a pic of my structure). Next I want to be able to create a record of a "complaint report" for that part in the combo box... (see structure). Any ideas?
Many thanks,
Rob

View 1 Replies View Related

Combo Boxes

Mar 2, 2005

I have read the cascading combo box solution and would like to know if this would help me with my specific solution.

I have a subform that is used to populate a table which is later used to cost each row by linking to a costing table (see later).

3 off the columns in this form have been set up as combo boxes e.g.

(1)Supplier/(2)Product type/(3)Product 2 is dependant on 1 and 3 is dependant on 1 & 2

These combo boxes currently refer to my costing table to ensure that the user can only enter a combination that is in this table so that when I compare the data entered in my subform table these combinations will be present in the costing table.

I get the 2nd combo box to show only the product types available for the selected supplier by afterupdate me![Product type]requery on the 1st combo box

The 3rd combo box is dependant on both 1 & 2 so I have applied afterupdate me![product]requery which has filters in the query as follows
Forms![subform]![Supplier]
Forms![subform]![Product type]

This seems to work ok when entering data initially into the form which places it directly into my table

The problem I have is when someone later goes into a record and changes combo box 1 and the data in combo 2 & 3 may now not be an option so how can I force them to go and re-visit these filed before exiting the form?

The second problem is if they go to the next record in the form and select the 3rd combo box to edit the field the qry does not show the correct option and shows the ones for the previous row?

Any suggestions please..

View 5 Replies View Related

Help With Combo Boxes

May 9, 2005

I have a Order form that i would like to use combo boxes when adding details records to the order. For example, my list of products is very long, each product belongs to a Series(category) I would like to create two combo boxes when placing an order. First one to select series, then another one to select product. I would like the product combo box to show only those products related to the series. Seems like a simple task but i am having so much trouble. I tried looking at the Northwind db because it has categories and products but in their order form their combo box just list products and there is no example like the one i want to do. Can anyone help?

View 1 Replies View Related

Help W/ Combo Boxes

Jun 21, 2005

Hi,

I have attached a small version of my database/form. I am trying to display only those records in a subform based on the values selected from two combo boxes. So when the user selects a client from the 1st combo box, the 2nd combo box is populated with the tests that pertain to the client selected. When the user selects a test from the 2nd combo box, I want the records to update with only those records that have the test for that client. So if there is no record for that test, then no records should be displayed (even though they may have records for another test - not sure if that made sense...).

My whole purpose is to allow the user to select a test only once and only have to select the level list based on however many levels are available for that test (I want it to be simple for the user).

Example: Open up my form, select Alabama from the clients list.
The subform has all of the tests for the client and the levels. Select Physics from the tests list. I now want the subform to display only the records were Test=Physics.
Once I get that working, I will make ClientID and Test in the subform not visible (only the Level drop down list will be displayed). So when a user selects a level from the list, the table needs to get updated with all of the information (clientID, testID, levelID).

Have any suggestions? Any help will be much appreciated.

Thanks,
dbnewbie

View 3 Replies View Related

Combo Boxes

Sep 3, 2005

I'm sure this question must have been asked before but I can't find it here, so my apologies.

I have a form for collecting addresses, it has two combo boxes, the first contains a list of states, and then the second contains a list of postcodes found within that state based up a query with the criteria

[forms]![FRM_Delpoint]![StateID]

the problem is the second combo box always shows the list relevant to the first record.

View 5 Replies View Related

Combo Boxes

Oct 6, 2005

Hi all,

I have a combo box who's Row Source Type is set to Table/Query and who's Row Source pulls 2 columns of data from an existing table (UserID;UserName).

I would like to set the first row on the combo to "*;Select All" and follow this by "UserID;UserName" for all users in the table.

I've tried using combobox.additem Item: = "*;Select All",Index: = 0 but it requires the combo box to have the Row Source Type set to Value List though I'm not sure how to pull in the table data if the type is set to Value List.

Any Idea's how I can get around this problem?

Thanks,

Dave

View 3 Replies View Related

2 Combo Boxes

Oct 28, 2005

In my form I have 2 combo-boxes. The first combo-box is linked to the 2nd field in my table, the 2nd combo-box is linked to the 3rd field in my table.
The selection of the 2 combo-boxes should show the content of the 4th field in my table.. No matter what I tried I could not get it to work.. Can somebody help me ?? :eek:

View 5 Replies View Related







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