Create A Combo To Fetch Record In A Subform

Jan 23, 2012

I Created three tables: 1. students, 2. subjects, 3. Marks. The Students table have a unique code for each student, with field name as StudentID, so the Students table contains fields:

a) StudentID a unique code for each student.
FirstName
Address
Phone

b) The Subjects table will have fields:
SubjectID a unique code for each subject.
Subject full title of the subject

c) The Grades table have just three fields:
StudentID a code that ties this entry to a student in the Students table
SubjectID a code that ties this entry to a subject in the Subjects table
Grade the mark this student achieved in this subject.

After creating the three tables, Margaret needs to create a link between them. In Access 2007 and 2010,

Relationships is on the Database Tools ribbon. In Access 95 - 2003, Relationships is on the Tools menu (or the Edit menu in Access 1 -2.) "Grades" will be the "related table" in relationships with both the other tables.

Now I could enter all the students in the Students table, with the unique StudentID for each. I enter all the subjects in the Subjects table, each with a SubjectID. Then at the end of term when the marks are ready, I could enter them in the Grades table.

To enter marks, I created a form, using the "Form/Subform" wizard: "Subjects" is the source for the main form, and "Grades" is the source for the subform. Now with the appropriate subject in the main form, and adds each StudentID and Grade in the subform.

The grades were entered by subject, However to view them by student. I created another form/subform, with the main form reading its data from the Students table, and the subform from the Grades table. Since I used StudentID when entering grades in the previous form, Access linked this code to the one in the new main form, and automatically displays all the subjects and grades for the student in the main form.

Now I would like to create a combo search field in the Header or anywhere in the main form to find the record based on StudentID in the Subform.

View Replies


ADVERTISEMENT

Forms :: Using Combo Box To Fetch Information On A Form

Aug 13, 2013

I have a form that is used for data entry; from there I want to create a new form where I can select a field from a combo box which would generate the amount associated.

Example on the first form it has a Carpenter that has a calculated output of $1000, on the second form I would want to click on the combo box and pick carpenter and I would like the calculated field to be shown next to it.

I tried making an if statement on an unbound box but I found it difficult

=IIf([Combo2]=Building Service Engineer, =[Forms]![Estimate]![Text787],IIf([Combo2]=Carpenter,
=[Forms]![Estimate]![Text788],IIf([Combo2]=Custodian,
=[Forms]![Estimate]![Text789],IIf([Combo2]=Custodian - Shift Pay (5am - 6am) ,
=[Forms]![Estimate]![Text790],IIf([Combo2]=Drafting Technician,

[Code] ......

[Text787]-[Text805] are fields from the first form, these are calculated fields that multiplies wages quantity etc.

Also [Combo2] wont let me pick any data that I typed in.

View 3 Replies View Related

Create New Record On Form And Subform Simultaneously

Apr 9, 2006

When I click the new record command button which I created I get a new record, but the form has a subform and this starts with no records. How can I program this button to not only create a new record and the form to which it relates, but also to create a new record on the subform contained within it as well??

View 3 Replies View Related

Modules & VBA :: Unable To Create Duplicate Record On Subform

Nov 29, 2013

I am trying to create duplicate records from a main form frmManagers which has a subform frmSubMeasure. I have placed the duplicate button on the main form. It creates a duplicate of the main form data and gives me the option to add new record to the sub. I want the duplicate to be created on the sub form for me to just edit the scores.

I don't know how to pass the sub form data to be duplicated I thought the append query which I used would update the tblSubMeasure table which created the subform frmSubMeasure.
In the sub the append query do update the form with the new MeasureID from the mainform and the form is available to enter new data. I want the subform data to be duplicated as well

In the query I included all the fields from the tblSubMeasure table and this is appended to the same table tblSubMeasure and I place a tag on the MeasureID using "[Forms]![frmManagers].[Tag]"

Code:
Private Sub btnDuplicate_Click()
Dim dbs As DAO.Database, Rst As DAO.Recordset
Dim F As Form
'Return Database variable pointing to current database.
Set dbs = CurrentDb
Set Rst = Me.RecordsetClone

[Code] .....

View 1 Replies View Related

Forms :: Create A Filter To Eliminate Any Record From Form Where Nothing To Show In Subform

Jun 7, 2013

I've got a hopefully an easy question - how to create a form filter? I've got a form with a subform. Form is showing all records from a table, but some records on the subform are blank. I want to create a filter which will eliminate any record from the form where there is nothing to show in the subform.

View 8 Replies View Related

Forms :: Create New Record In Form - How To Requery Subform To Link Properly

Apr 2, 2013

I have a form (frmAddManifest) with a subform (subfrmManifestTransporters).

When creating a new record, I can enter data into frmAddManifest, but the subform doesn't update to link with the record - I presume it's because the record from the main form hasn't been completed yet.

Is there a way to requery the form and/or subform so it stays on the record I was working on, and link the subform properly?

View 4 Replies View Related

Find A Record Combo On A Subform

Sep 11, 2006

Hi all,

I have a form for accounts, which has a subform listing the customers within each account.

On the customers form I can use the wizard to add a combo to find a record, but if I want to add a similar combo within the subform, the option does not appear in the combo wizard.

Can anyone enlighten me on why/how to resolve?

Many thanks

Mark

(using Access 2003 on an Access 2000 format db, Win XP Pro SP1)

View 1 Replies View Related

General :: Display Record In A Subform Based On Combo Box Value

Oct 11, 2012

I'm creating a database for my inventory. For now, my database have two tables namely tblSupplies and tblDetails. I have a main from (frmMain) and a subform (subDetails). On the main form i have a combobox (cboSupplies) and 5 textboxes, the cboSupplies and the five textboxes are unbound. If I select a value in cboSupplies it will populate the rest of the textboxes-OK.

What I want to accomplish is that when I select a value in cboSupplies it will grab all related records from the tblDetails and populate these records on the subform (subDetails).

SuppliesID was used as the link field from mainform to subform but its not working. Please note that SuppliesID field in tblSupplies and tblDetails has a One-to-Many relationships.

View 1 Replies View Related

Forms :: How To Create A Form That Can Edit Or Create A Record

May 13, 2014

I am trying to create a form to enter data in a table. I would like to make it pull in info from a switchboard. If the record already exists I would like it to find it and allow me to edit the info. If the record doesn't exist I would like to be able to add a new record with the data input. What is the best way to accomplish this?

View 1 Replies View Related

How To Fetch Database Col Name?

Oct 24, 2004

Dear Friends,
I have a query
I want to fetch all the database column name in a table in MS access 2000. Pls can anyone help

View 1 Replies View Related

Forms :: Highlight Unbound Subform Record That Matches Other Subform Record

Jan 22, 2014

I have two unbound unlinked subforms residing on a 3rd unbound main form. When I enter the current record on Subform1 I would like the matching record(s) on Subform2 to be highlighted or otherwise formatted. I can get this to work for only the first record on subform2 due to the way I have my code setup on Subform1:

Code:
Private Sub Accounting_Unit_Enter()
'find where AUs match. only works for first Subform2 record
If Me.[Accounting Unit] = Forms!MainForm.[Subform2]!AccountingUnit Then
msgbox "Match"
End If
End Sub

My thought was that I needed to reference the Recordset of Subform2 and search for all AccountingUnits that match the current AccountingUnit of Subform1,

View 6 Replies View Related

Forms :: Select Record On Subform To Select Default Value In Combo Box?

May 6, 2014

I have a subform containing a list of Funds and attributes such as Asset Type, Fund Manager, etc.

Currently, I have a textbox, where the the control source is set so that it will be updated with the Asset Type from the subform.

I also have an unbound combo box that contains a list of Asset Types queried from a table via row source, where user can select the Asset Type.

What I would like is when a record is selected from the subform, the Asset Type is selected on the combo box as a default value. User can select another Asset Type if required. How can I do this?

View 1 Replies View Related

Using DLOOKUP To Fetch Data From Table

Oct 28, 2013

I am facing issue with DLOOKUP,

Actually the program flow is like i have a table of 25 fields, ID as PK and item name, item code and remaining is the date as field name,

Below mentioned is the Table headings,

"ID" "Item Name" "Item Code" "10/29/2013" "11/5/2013" "11/12/2013"

Problem is that when im doing dlookup on date getting wrong result...

This is what I am using in my codes.

DLookup("11/12/2013" , "tbl_Name", "ID = " & rs.Fields("TRANSID") & "")

View 4 Replies View Related

Modules & VBA :: Fetch Initials (First And Last Letter) Of Username

Dec 24, 2013

How can we store the first and last letter of the username using vba.

E.g. my name is "Daniel Rawlings" then it should display "DR".

View 1 Replies View Related

Macro To Fetch Recordset Corresponding To Reference Value From Table

Mar 3, 2014

I reused one macro to develop a form in MS access.

The macro fetch the record set corresponding to the reference value from the table.

The reformat value is a numeric field.

The macro code is :

Private Sub Modifiable20_AfterUpdate()
Dim rs As Object
Set rs =Me.Recordset.Clone
rs.FindFirst "[Reference_Number] = ' " & Me![Modifiable20] & " ' "
If Not rs.EOF then Me.Bookmark = rs.Bookmark
End Sub

What to change in the above code to make it work....

View 3 Replies View Related

Forms :: Columnar Sub Form Text Box Fetch Query?

Jun 24, 2013

I have a Columnar Sub form for for a Sales order for capturing the item details.

I have setup a combox for item code for which the respective item description data has to be fetche from item master table and populated in itemdesc table.

I am written a after update code in the combo but after selecting each row the item being fetched and updated in all rows is of the last row.

*********
Private Sub itemcode_AfterUpdate()
Me.itemdesc.Value = DLookup("[Description]", "itemMaster", "[code]='" & [Forms]![frm_invtmpDetails]![itemcode] & "'")
End Sub
*********

View 7 Replies View Related

Reports :: Can Fetch Calculated Field From A Form In A Report?

Mar 24, 2014

I have a form which works good enough. In this form, there is a text box that counts and calculates records from a subform. The name of this text box is "text1" ...

Can I fetch this "text1" field in a report ?

View 10 Replies View Related

Modules & VBA :: Fetch Combobox Text In Email Body Of Outlook?

Apr 25, 2015

I am trying to fetch combobox dropdown text (in the networks label ) into the email body but in vain.

Whichever networks are selected in the six dropdowns should go to email body as you can find in the attachment ...

View 1 Replies View Related

ODBC Driver - Fetch Data To New Excel Sheet According To Query

Oct 26, 2011

I have oracle ODBC Dirver which easily connect and fetch data to a new excel sheet according to the query.

But I want to fetch data to a access table from a remote server database which will automatically update the data, through the query saved.

Excel is working good with automatic update option but can't fetch data to access table.

View 2 Replies View Related

Forms :: Filtering A Combo Box On A Subform From A Combo Box On A Main Form

Apr 27, 2013

I have a Suppliers database which contains a form that will allow me to place orders with Suppliers.The Main form has a combo box that allows me to select the supplier. The combo box is called SupplierID with the following:

Row source: SELECT Suppliers.SupplierID, Suppliers.CompanyName FROM Suppliers ORDER BY Suppliers.CompanyName;

The subform is called Stock Subform witha combo box called ProductID with the following:

Row source: SELECT DISTINCT Products.ProductID, Products.ProductName, Suppliers.CompanyName, Products.Discontinued FROM Suppliers INNER JOIN Products ON Suppliers.SupplierID=Products.SupplierID WHERE (((Products.Discontinued)=0)) ORDER BY Products.ProductName;
Event Procedure - AfterUpdate: Private Sub ProductID_AfterUpdate()
On Error GoTo Err_ProductID_AfterUpdate
Dim strFilter As String
' Evaluate filter before it's passed to DLookup function.
strFilter = "ProductID = " & Me!ProductID

[code]..

The Link fields are done on the Purchase Order ID (PONoID).What I want to achieve is to select the supplier from the combo box (SupplierID) on the main form and then the combo box (ProductID) on the subform to filter to only show products directly supplied by the Supplier selected on the Main Form.

View 11 Replies View Related

Forms :: Get Subform To Requery After Choosing A Name From Combo Box On Subform Itself

Jul 26, 2013

All I am trying to do is get a subform to requery after choosing a name from a combobox on the subform itself, thus updating the records on the subform. The main form name is "BasicTestOneF" the subform name is "ICminiBasicF" and the combobox name is "Combo4"

I have the combobox requery on After Update, but I still get the "Enter Parameter Value" popup. I've spent the last hour and a half just trying to get this simple thing to work and have gone through I don't know how many sites and forum posts, tried every combination of VBA code I've found, and I still can't get it to work.

View 14 Replies View Related

General :: Subform Combo Box Restricted By Form Combo Box

Mar 28, 2014

I'm an Access newbie and I'm having trouble restricting a combo box on a subform based on the selection of the combo box on the form.The combo box (Combo1) on the main form (FrmOrganisation) gives a list of companies, I want the combo box (Combo2) in the subform (SbFrmEmployees) to list people only from that company. I then have a subform within that subform that displays information about the employee.

View 3 Replies View Related

Forms :: Selecting Record In Parent Subform From Child Continuous Subform

Jan 26, 2014

I have two subforms on a main form. Both use similar queries and nearly the same set of records and PK. The first subform is for data entry and the 2nd subform is a continuous form that lists the entries in order that are made from the 1st Subform. (for entering in vacation days and appointments)

The continuous form cannot be edited, it is to be a list for viewing the information only.

I have an edit button next to each record on the continuous form. When the button is clicked, I want it to take the 1st subform to that specific record as well (same PK), so the information can be edited there.

I cannot figure out how to get the 1st subform to go to the record on the continuous form when the button next to that record is clicked on the continuous form.

I tried the DoCmdSearch for record and just keep getting object is not open errors.

View 2 Replies View Related

How Do I Create A Combo Box Of Fields

Mar 21, 2006

Hi everyone, first off, I did a search of "combo box fields" and it turned up some results but after going through them, I still didn't think it answered my question.

I want to create a combo box of fields from a table. After selecting a field, I want to choose from another cbo either "Yes" or "No" to fill out that particular field.

How do I do that? Thanks all.

View 5 Replies View Related

How To Create Combo Box Filter

Dec 7, 2012

I`m using access 2010 version, i have one table(Customer) which has one-to-many relationship to the table(Order), so the Order table contains many records from one single record in Customer. How to create a combobox that filter and show how many orders the Customer has. Example:

Table(Customer)
Line 1 - Crystal

Table(Order)
Line 1 - Water
Line 2 - Cookies
Line 3 - Pens

View 4 Replies View Related

Automatically Create Records In Subform

Apr 11, 2006

I have searched, but found no reference to my exact question. I have a list of drivers I need to create a checklist for each day. The Parent form is the day and the subform is the list of drivers. What I would like to do is have a command button automatically enter all the drivers that are active (denoted by a chechbox) into the tabular subform.

View 14 Replies View Related







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