Forms :: ComboBox To Pop-up Form To Add Data
Nov 13, 2013
I'm working on a db that will track students for a summer camp. One of my fields in my student records (CamperInfo) is "School". Currently, the field is set up as a combobox in the CamperInfo Subform in the FamilyInfo form. I would like the combobox to be able to add schools if the school is not listed by a pop-up when the "add school" (or whatever) is selected.
Code:
Private Sub School_AfterUpdate()
On Error GoTo Err_School_AfterUpdate
Dim strForm As String
If Me.School = "Schools" = True Then
strForm = "Schools"
DoCmd.OpenForm Me.School
Err_School_AfterUpdate:
MsgBox Err.Description
End If
End Sub
As you might have guessed, it doesn't work. no errors, it just doesn't do anything. I added the "Schools" data.
View Replies
ADVERTISEMENT
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
May 17, 2015
Is it possible to populate a single combobox with data from 3 different tables.
I have a table called observations (for observing deer), in that table is a field called Location, I have 3 other tables that list possible locations t_foodplots, t_stands and t_section.
I would like to have a combobox called location on my observations form that will allow me to select the proper location from one of those 3 tables, the choices would be something like this...
Section 1
Section 2
Section 3
Stand 1
Stand 2
Stand 3
Foodplot 1
Foodplot 2
Foodplot 3 etc....
The chosen value would be stored in the t_observations "location" field.
View 1 Replies
View Related
Apr 16, 2014
I have a small form with a combobox that gets its data from a query.
I added code to this database to forward to me info about forms and controls in case they generate errors. Occasionally I get an "error = 0" on this combobox.
Since there are no events attached to this combobox then what could be causing this error?
View 8 Replies
View Related
Jul 7, 2015
I have a main form and a several subforms. The main form displays potential customer data and 1 of the subforms displays the advertisement that prompted that customer to call. 1 of the Advertisements is newspaper ads and for that one we want to track which newspaper.
The subform has 3 pieces of data. The advertisement type, advertisement date and a hidden field for the customer ID to link those to the appropriate customer. There is also a requirement for a field for the advertisement source for newspaper ads.
Data Structure:
Customer Table
CustomerID
Customer demographic data as fields
Advertisementtype
AdvertisementTypeID
AdvertisementType
SpecificAdvertisement.
SpecAdvID
Advertisementtypeid
advertisementdate
advsource
sample data
Customer
1
John
Smith
1234 some st
somecity
somest
somezip
Advtypes
1 google
2 Newspaper
3 Radio
specificAdv
2
7/7/2015
Daily Press
I have a combo box that gets the advtype Then another combo box that gets the adv date the issue I'm having is I also need the source and If I put it in the combo box it only displays when that combobox has the focus otherwise only the date shows. If I try to use a textbox to display the data I can only get the firstcolumn in the combobox and not the column I want. If I use the same query the combobox uses but only having the source in the select criteria I get the same data for every record. Since there are multiple advertisements and a customer could reply to any of them or all of them.
View 1 Replies
View Related
Jan 20, 2014
I'm building a new db for tracking tests/results, using Access 2007.
On this issue, I'm working with 2 tables, Sample and Equipment.
On a form to enter sample info, I have a combo box to select a piece of equipment.
When the equipment is selected, I need to have a sub-form populate with several fields of data from the equipment table, based on the equipment selected.
I'm not trying to save the equipment data again, I just need to display it, based on the equipment the user selects. This is just a kind of second check to remind the user what the equipment he's selected will do.
View 5 Replies
View Related
Mar 16, 2005
Hi,
I've got a data entry form where orders can be created. Within this form there is a ComboBox which is used to search for items and stores the selected item ID in the Order table. However the field for storing the Unit Price relating to the selected item is currently manually enterable. Where as I would like this to be dependent on the item selected within the ComboBox and updated automatically.
At the moment I've added an extra colum to the ComboBox to retrieve the relevant Unit Price and I can show this in a normal seperate text box using '=Combo27.Column(1)' as the ControlSource.
How can I get rid of the text box and incorporate the code into the current UnitPrice field so as it inserts the relevant record (price) into the UnitPrice coloumn of the Order table?
Any help on this would be much appreciated!
View 1 Replies
View Related
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
Dec 3, 2013
I have a combobox (cbo_Breed) that Holds the Breed_ID, Breed and BreedType_ID.
On the form opening I want to look at the thrird column and if its a "1" then to do something. How do I get the form to look at the third column? This is what I have written (I know its wrong, but needed a starting point)
Code:
If Me.Breed.[Column](3) = "1" Then
View 5 Replies
View Related
May 2, 2015
Private Sub CardName_AfterUpdate()
Me.Purchasing = Me.CardName.Column(2)
Me.Selling = Me.CardName.Column(3)
End Sub
I get value of Column(2) in Purchasing textbox but in Selling textbox not why?
View 14 Replies
View Related
Aug 13, 2014
I have a unbound combobox in my form. I wanna populate list value in my combobox. first value is current year. Every time populate 6 values. like as
2014-2015
2015-2016
2016-2017
2017-2018
2018-2019
2019-2020
View 1 Replies
View Related
Oct 28, 2014
I'm having some trouble opening a group of forms using a combobox. I think I'm really close, but I'm having some errors that prevent me from doing so.
I have a Combobox called "Letter Type" that contains the names of all of the other forms that exist. I want to be able to select a form from the combobox and click on the button "Compose." This should then open that form.
I had some trouble trying to get the Combobox value to work properly so I decided I would just create a hard workaround by using If/Then statements.
This is what I have in the On_Click event of my button.
Private Sub Compose_Click()
If Me.Letter_Type = "Refund Request" Then
strForm = "Refund_Request"
ElseIf Me.Letter_Type = "Request for Records" Then
strForm = "Request_for_Records"
End If
DoCmd.OpenForm strForm, , , Me.[Reference_#] = Forms![Reference_#]
End Sub
The catch is that I want the form to only open with one record and I want that record to be the same record the user was viewing on the previous form. I thought I would tie them together using the "Reference #" since it is unique.
When I click on Compose I get a "type mismatch" on the Reference #, though I'm not sure why.
View 5 Replies
View Related
Apr 26, 2014
The combobox in the frmResellerOrders works correctly until I include it in the Navigation form frmMainMenu. Once I include it the navigation form it no longer lets me select a value. I have read numerous articles about using the
Forms!YourMainFormName.YourSubformContainerName.Form.YourControlName
However, none of these seem to mention when and where to use it. Do I put it in the query that the form is linked with or do I need to put it in my form somewhere? I have been trying to fix this off and on for over a week now. It is one of the last parts of my database that I need to get finished by Monday!
I have attached a copy of part of my database with some dummy data.
View 2 Replies
View Related
Sep 25, 2013
I have a database with a Supply Receipt Form. The first field in the form is a combobox for the user to select a material/supply. I'd like for the form to open to a new record every time. When I use:
DoCmd.GoToRecord , , acNewRec
in the Form On Open property, I lose the ability to select the material/supply. Same thing happens when I set the Data Entry property to Yes.
View 3 Replies
View Related
Mar 3, 2014
I have almost completed creating a continuous form which I want users to be able to filter though the records based on to/from date, badgenum and a response string.
I then want to have a button, btnSelect, that will select the remaining records and open a report based off only the remaining records.
1.) Everything on the continuous form works except when trying to filter a combo box, cboBadge, field name "BadgeNum". BadgeNum is data type "short text". I have modified the code below from the following Allen Browne link. It keeps throwing a debug on me.Filter = strWhere at the bottom of the btnFilter sub.
2.) As far as the btnSelect and printing remaining records, I guess I'm not sure where to start.. I currently have another print button that will print individual records only which works fine.
[URL] ....
Code:
Private Sub btnFilter_Click()
Dim strWhere As String 'The criteria string.
Dim lngLen As Long 'Length of the criteria string to append to.
Const conJetDate = "#mm/dd/yyyy#" 'The format expected for dates in a JET query string.
[Code] ....
View 4 Replies
View Related
Apr 24, 2013
In my quality control database QC techs will be entering in test results. Each quality control entry they put in will have a product and lot number it is related too.
My question is about making data entry easier for the QC techs. When two jobs are being run at once, the techs may have to alternate between which jobs they enter, meaning a different product and lot number. It would be frustrating for the QC techs to enter in a product code and lot number for every entry they make.
Can the lot number field be automatically populated when the tech selects a product? Basically, if the tech selects product A, can the last lot number value for product A automatically populate the field in the new entry?
Edit: Currently I have the "solution" of making two instances of the entry form with each lot number entered on the different one. This allows the QC Techs to use the CTRL+ ' to populate the last record, allowing them to quickly enter the product code, lot number, and date of the job they are working on.
View 3 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
Jan 27, 2014
I have combo box in a form. I want to enable (to highlight) some controls in the form after selecting any value from my combobox.
For example, There are three values in the combobox. And :
When I select value1, I want an unbound combobox1 to be enable (This combobox is synchronized with a bound combobox2). So when this unbound combo is enabled, its synchronized bound combo should also be enabled.
When I select value 2, it should do the similar action on a different unbound combobx3 (which is synchronized with a combobox4).
View 11 Replies
View Related
Jul 10, 2015
I'm creating an Audit form with a combobox from which the employee name performing the audit can be selected. The data source is the EmpNames query which selects from the Employees table, linked to another database. The EmpNames query includes a record selection criteria where Employees.TermDate is null so that terminated employees will not appear in the dropdown list.
This is fine as audit records are being added in the form for current employees, but in the future, if an employee is terminated and we go back to one of his audit records, the name will be blank because EmpNames won't include it. The Audit table doesn't store the employee's name -- just his employee ID, and the combobox has a two-column data source where the column 1 width is 0 and column 2 is the name. Is there a way to have only current employees be selectable but still be able to see terminated employees in existing audit records?
View 4 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
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 4 Replies
View Related
Nov 25, 2014
I have a multirecord continuous form that displays the results of a query. At the end of each row there is a combobox displaying a list of form names. The user selects one of these forms from the list and program fetches the detail data in that selected form corresponding to the row where the cursor is. Now the beforeupdate or aferupdate or onclick functions do not work. Her are the properties of the combobox as JPG files and the code of the not working function.
Code:
Private Sub Sbox_AfterUpdate()
Dim ForName As String
Dim ParName As String
Dim QryName As String
MsgBox "after update combo"
ParName = Me.Form.Name
Select Case Me.Sbox.Value
[Code] .....
View 4 Replies
View Related
Feb 25, 2014
I want to empty the combobox every time when form loads. Using the below code
Quote:
Private Sub Form_Load()
combo1.RowSource = ""
End Sub
But Combobax is not emptying.
View 6 Replies
View Related
Jul 24, 2014
This DLookUP works correctly...
UNDER CONTROL SOURCE:
=DLookUp("[First Name]","Contacts","[Combo378]='" & [Forms]![PROFILE]![Combo378] & "'")
but when a I want to close the form, display the error:
You must enter a value in the Profile.First Name
I junt need the way to update the field in the new table...
View 6 Replies
View Related
Jun 6, 2013
There is a command button on my form that calls a filtered query. I'm filtering the query based on a combo box within the form using
[Forms]![frmAssignDwgs]![Combo15]
It works beautifully until I put the form as a subform in the Navigation Form I'm using. When I execute it from within the Navigation form, it errors out looking for [Forms]![frmAssignDwgs]![Combo15].
Is there another syntax I can use so this will still work from within the Navigation Form? Or another way to approach this functionality?
frmNavigation is the main navigation form
frmAssignDwgToPkgs is the subform that holds Combo15
I found another thread (which I can't link to since I'm new) and tried various arrangements of the following to no avail.
[Forms]![frmNavigation]![NavigationSubform] .[Forms]![frmAssignDwgToPkgs]![Combo15]
View 3 Replies
View Related
Apr 14, 2014
So I have a combobox in a form that lists the values of a field in a table. The rowsource is this:
Code:
SELECT [Estes Training Modules].[Training Module], [Estes Training Modules].[Period] FROM [Estes Training Modules] ORDER BY [Period];
The problem is that ALL values on that field show up, including repeated values. I only need each different value to show up once. How can I do that?
For example, what I get in the combobox is: Annual, 2-Year, Annual, Annual, 2-Year, 3-Year,...
What I need is: Annual, 2-Year, 3-Year,...
View 10 Replies
View Related