Populating A Subform Item To Another Subform Item.

Dec 21, 2006

Hey all.

I'm trying to get a combo box to populate the box next to it.

Basically pick a project number in the 1st box and have the project name show up in the second box.

I have it working, but the problem is that when it puts in the name of the project, it fills the whole column with that name, and not just the one box.

Here is what it's doing:
http://img156.imageshack.us/img156/2659/dbhm4.jpg

Here is the code im using.

Private Sub ProjectNumber_AfterUpdate()
On Error Resume Next

Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strSQL As String


ProjectNumber.SetFocus
If ProjectNumber.Value > 0 Then
strSQL = "SELECT * FROM ProjectList WHERE ID = " & ProjectNumber.Value

Set db = CurrentDb
Set rs = db.OpenRecordset(strSQL)
If Not rs.BOF Then
Me.ProjectName = rs("ProjectName")
End If
rs.Close
Set rs = Nothing
db.Close
Set db = Nothing
End If

End Sub

Let me know what I can do.

Thanks!!

View Replies


ADVERTISEMENT

Summing A Subform Item

Apr 14, 2005

I'm having trouble with a text box, which is trying to sum some date in a subform. All I get is #Error, yet I'm sure I'm referencing the item in the subform OK. I've attached the database as it's self explanatory (I stuck a label on it).

The form I'm having trouble with is frmPurchaseOrdersDataEntry and you'll see what I'm getting at from there.

Any help most appreciated.

Ste

View 2 Replies View Related

Multiple Item Subform?

Nov 6, 2004

I am creating a form that will require entry of first names, last names, and ID's of either none, or any number up to 15 people involved in a particular project. I am trying to accomplish this with a subform that links to the main form using the main forms primary key.

When done, you will be able to enter data into the record (project name, date, etc), go to the subform and enter the Primary Key (an AutoNumber), then the 0-15 names & ID's into the subform one netry at a time, with all entries linked via the primary key to that particular record. One problem is that the subform always displays the info for the previous records. I also want to be able to "get out" of the subform and back to the main form saving all subform data along with that record. (am I making sense?) and have the subform reset back to blank for the next record. I am completely lost and don't even know if I am approaching this in the right way. Any help would be greatly appreciated!!

View 1 Replies View Related

Use Record Number For Item Numbering In Subform

Sep 22, 2004

I want to use the record number to automatically number items entered into a subform. Anybody know how to do this or if it can be done?

View 2 Replies View Related

Modules & VBA :: Invoice And Subform - Add Multiple Record (Item) At Once

Mar 23, 2014

I almost complete my mini project - Stock Inventory:

To track Items enter and exit from Videoshop or simply known as Stock Transaction (IN/OUT). This also include a Inventory Catalog which basically show all the Items in the Videoshop, each Items details including category, transaction type description and most importantly quantity on hand.

As mentioned above, I almost complete the database except the most important Form - New Stock Transaction where User enter all the necessary details to issue an IN or OUT Transaction. To make things easy to understand, it share many similarity with Invoice and New Order.

Code:
Main Form (Table: StockTrans)
Trans_ID
Trans_Type
Trans_Date
Trans_Cust
Trans_Note

Code:
SubForm (Table: StockTrans_Items)
Trans_ID fk
ItemID fk
Trans_Item_Qty

When I finished records entry and enter Invoice completed button then it will auto update the Item Quantity on Hand.

View 1 Replies View Related

Populating Page Based On Item Chosen

Jun 20, 2014

What i am try to do is have specific text boxes or items appear on the form depending on the combobox item you have chosen.

For Example

Combobox

CAR
CAKE RECEIPE
CLOTHING

if car is chosen 2 text boxes appear example car manufacturer, Car name. If Cake recipe is chosen a larger text box appears, if Clothing is chosen another combo box appears and gives you more options.

View 5 Replies View Related

Setfocus On Repeating Item/accessing A Specific Item

Aug 18, 2006

I have a form that simply lists the items:
DEPARTMENT_NBR and DEPARTMENT_NAME

In the table: DEPARTMENT_TBL

When I edit the field DEPARTMENT_NBR and it is in error (must be between 01 and 99) I want to put out a message in a MSGBOX and SetFocus back on the DEPARTMENT_NBR.

I coded the MSGBOX with vbokonly and then DEPARTMENT_NBR.SetFocus, but after the message displays and enter is hit for the ok the cursor jumps to the DEPARTMENT_NAME on the current line. Is there a way to get the SetFocus to work properly on repeating items like this? I can never seem to get them to perform the same as they do on non-repeating items.

Thanks for your help.

HERE'S THE EXACT CODE:
If IsNumeric(DEPARTMENT_NBR) = False Then
If DEPARTMENT_NBR <> "00" Then
MsgBox "DEPARTMENT NUMBER must between 01 and 99.", vbOKOnly
DEPARTMENT_NBR.SetFocus
GoTo DEPARTMENT_NBR_EXIT (exits the paragraph skipping other checks)
End If
End If

Also, is there a way to look at a specific item in a list like that? IE. I want to reference the 3rd row's DEPARTMENT_NBR. Thanks.

View 4 Replies View Related

Dyanamically Populating SubForm

Apr 28, 2005

I have a form (Form1) with subform (SForm1) embedded in it. Now my Form1 is based on query (query with search criteria) which is dynamically linked (with VBA code). I want to populate SForm1 dynamically with records based on one field (customerID) of Form1.
I am able to populate Form1 with search query, however, the SForm1(subform) is not populated. The SForm1 is based on query with criteria which is supplied by (customerID) in the Form1.
Any help is appreciated.
Thankx in advance.
Prodigy.

View 8 Replies View Related

Forms :: Pre-populating A Subform

Apr 21, 2015

I have a Form1 and Sub Form2...Form1 is a list of tasks: Each task has a quantity of Items.The forms are in Datasheet format.I have a list of people who can only do specific tasks and at present my Form2 is able to only select the relevant people for that task.The only way to "Trigger" who can do which task is to populate what quantity of work I want them to do. ie. create a link.

Is there anyway of clicking the little + button on Form1 that it prepopulates the total quantity to Form2 therefore creating a link and therefore being able to select who can do that task.If you look at the pic I want Items in the dropdown box to pre populate with the same amout as in the Form1 Items ie "1"

View 1 Replies View Related

Forms :: Access Subform Not Populating

Jan 1, 2014

A subform on a main form is not populating after the user clicks on the subform and then returns to the main form and updates the field which the subform is linked to. The first time the subform populates absolutely okay; however once the user clicks on the subform and then returns to the mainform and updates the field which the subform is linked to the subform goes blank.

View 7 Replies View Related

Forms :: Populating Fields In A Subform?

Mar 3, 2014

I have database as follows,

1- student table: stID (PK), firstName, lastName

2-course table: courseID (PK), courseName, courseDescription

3- studentCourse: stID(FK),courseID (FK)

Now, I have created a main form based on student table and a subform based on studentCourse table. However, because I needed to populate the courseName and CourseDescription in the subform I changed its record source to a query (stID, courseID, courseName, courseDescription) so that when I move between the subform records the courseName and courseDescription still show in the subform.

To populate the courseName and courseDescription in the subform I changed the courseID to a combobox so that it brings the courseName and courseDescription from the course table and show it in the subform.

Everything is working fine so far BUT when I choose to input a courseID manually into the combobox, it does not populate the courseName and courseDescription as it does when I choose the courseID from the combobox.

View 7 Replies View Related

Forms :: Pre-populating A Subform With Parent Data

Jun 2, 2015

I have a parent and sub form in dataset view.

What I would like to do is prepopulate the subform with data from the parent form when I create a new item of data..

i.e.
When I click the "+" button Field1 on my subform is populated by Field1 on the parent.

I have tried beforeupdate on both the subform properties and the subform.Field1 properties.

View 3 Replies View Related

Forms :: Subform - Combo Box List Not Populating According To Main Control

Apr 17, 2014

I am using MS Access 2010, I have three tables,

Policies (Id, Client Id, Address, Policy Amount, Paid)
Payments (Id, Client Id, Total Amount)
Payment Details (Payment Id, Policy Id, Paid Amount)

I have created a form "PAYMENTS" that include a sub form "PAYMENT DETAILS".

In the sub form control Policy Id is defined as combo box, and retrieving the list from Policies and Payments where Policies.Client=Payments.Client the query of Combo Box is as follows:

Code:

SELECT POLICIES.[POLICY ID]
FROM POLICIES
WHERE (((POLICIES.PAID)=False) AND ((POLICIES.CLIENT)=[Forms]![PAYMENTS]![ClientId]));

Only first time Combo Box display the Policy Ids according to the Client, but when I change the client and always displays the previous clients Policy Ids.

how to retrieve correct list of Policy Ids according to the Input Client in Payments.Client control

View 4 Replies View Related

Populating Subform #2 Field With Subform #1 Field

Jun 1, 2006

I have a mainform. I select from a couple of combo boxes. Based upon these selections, it pulls up appropriate info in subform #1.

There is a field in subform #1 which I want to populate a field in subform #2 with (automatically).

What kind of "event" is this? After/before? I tried everything, nothing works.

Let's try these naming conventions:

Main form = mainform
Subform #1 = subform1
Subform #2 = subform 2
Field Subform #1 = fieldsubform1
Field Subform #2 = fieldsubform2

Help me write the code and help me locate where to put that code. It's been troubling me for a long time.

Thanks, I hope someone can help me out.

View 2 Replies View Related

New Item In The Field

Feb 22, 2005

Hi

I have a field that contains some kinds of the student status, such as "Current", "Alumni" and "Expire". The table has already got a lot of records. How can I make a new item available to the field, for example, "Other", without entering a new status?

Like, "Student A" is "Current" but he is now "Other" status. When the user see his record, he/she needs to change the student status from "Current" to "Other". I don't want the user to enter "Other" manually. I want it to be available from a comb box at the first place. How can I add a new item into a field without entering a new student record?

Sorry, I am unsure that I explain enough ..

Thank you.
Gaufres

View 3 Replies View Related

Item Numbers

Feb 2, 2005

OK heres the deal:
I have an asset inventory database that i've made where item numbers 1000-1999 is one category 2000-2999 is one category, 3000-3999 is one category etc.

I've made a drop down menu with the choices, 1000, 2000, 3000, etc.

What I want to be able to do is, I want the computer to generate the item number from that drop down menu's selected choice. For example if the category 1000 is chosen i want the computer to be able to generate the next possible item number (without duplicating any item numbers).


Is this possible?
Thanks much for any help :)

View 4 Replies View Related

Item Searches

Jul 6, 2005

Hi everyone i was just wondering if anyone new how to do the following;

Data is entered into a text box named txtItemNo on exit a search is performed and the next textbox txtDescription displays the results.

There is a table with itemnumber and item description in it the results would be the description.

Any ideas? This is on a subform, dont think this amkes any difference though
Thanks in advance :)

View 2 Replies View Related

Listbox Item

Jul 28, 2005

My query is executing on everything in the listbox. I only want it to be executed on the value that i select. What codes can i use? I really need some help on this one.

View 1 Replies View Related

Add Item To Combo Box

Sep 9, 2005

When a user enters an item manually into a Combo Box MS Access Help shows how to add it to the 'Value' list. I need the code to add it as a record to the underlying table.
Note: The table has only one column.

Thanks

View 2 Replies View Related

Selecting Item From Combo Box

Jun 5, 2005

Not sure what to search for so I thought Id write a new post:

I have a combo box which selects 3 items-

Primary key, Surname, Firstname

After an item is selected, the fields are populated according to the item.

Since there will be many records, it would be nice if the user can begin typing the surname and have predictive text, so the three items should then be-

Surname, Firstname, Primary key

So my question is, how do I get at the primary key if it is not selected?

myText = dlookup("myValue", "myTable", "primarykey = '" & ???? & "'")

If this does not make sense, what I am trying to say is:

The surname is selected, but I want to do a calculation based on the primary key so I get all the data associated with that user. I cant use the surname because there are duplicates.

Thank you

View 2 Replies View Related

Calculating Totals Per Item

Jun 29, 2006

For some reason I can't write the proper query to get a simple total from a single table. Here is the basic table design:

Transaction ID___Product ID___ Transaction Date____Transaction Quantity
1______________Product A____6/12/2006__________200
2______________Product B____6/12/2006__________500
3______________Product C____6/14/2006__________100
4______________Product B____6/15/2006__________200
5______________Product C____6/16/2006__________300
6______________Product A____6/17/2006__________500

I'm trying to get the total transactions quantity for each product so that I could end up with a form or a report that would show:

Product ID_____ Transaction Quantity Total
Product A______700
Product B______700
Product C______400

... and so on for each item.

What would actually be entered in the query? I'm assuming I would have four columns in the query:

transaction id____product number____transaction qty____expression

Then I would use the SUM feature so the "group by" row appears.

Then I would build the expression above in an expression column. If that's correct, could you give me the expression typed "exactly" as you think it would appear? I'm getting syntax errors when I'm trying it.

And then, once I have the expression built, what should be the "group by" selection under each of the columns?

Sorry for being so ignorant. The rest of my data base works great... but I'm just not getting this one thing!

Thanks anyone who can help me!

View 4 Replies View Related

I Just Want To Select An Item In A Listbox!!

May 9, 2005

Hi Everyone!

I'm having problems and am frustrated as usual ;)

I'm trying to select a specific row in a listbox in the OnKeyDown event on my form. Basically, while in a subform, I want the enter key to move the focus to the list box, specifically to row After the last selected.

Here's an example of the code I thought would work:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim ItemNumber As Integer

ItemNumber = Forms![Product Inventory System]![InvList3] + 1

If KeyCode = vbKeyReturn Then
Forms![Product Inventory System]![InvList3].ItemData(ItemNumber).SetFocus

Else

End If
End Sub

I just started the Atkins diet today, so my sugar and caffiene levels are non-existant. (Seems like an easy excuse, right?)

Can anyone offer any insight into what I'm doing wrong?

Thank you so much!
Ben Bolduc

View 2 Replies View Related

'#Name?' And Inability To Select An Item

Jan 26, 2006

I have a combo box whose RowSource is set to

SELECT [Part Numbers].[Part Number], [Part Numbers].[Part Description], [Part Numbers].[Supplier Name] FROM [Part Numbers];

When I go to the Properties window and click on '...' to check the results of this query, I see exactly what I expect to. Likewise, clicking on the combo's drop-down arrow displays the data correctly.

However, when the combo box is displayed on it's Form, #Name? is always displayed and, while I can view the items in the list, I am unable to select any of them.

I've got a feeling this is going to be a simple correction, but I can't work out what's wrong and it's bl**dy infuriating.

Any suggestions gratefully received.

View 1 Replies View Related

Changing Combo Box Item

Feb 23, 2006

hi ,
i have a fro example menu and price database
that i entered Menu items and price of each other in it

and i linked this database to a order form that when i select for example capuchino it will give me 1 $ on price field

but the problem is here that when i whant to change the prices all of the past entered orders with last price will change to new one
how can i fix it ?
thanks

View 5 Replies View Related

Option To Specify An Item That Is Not Listed

Jun 9, 2006

Hi everyone,

I'm building a database that will allow me to enter medical information about patients. On the present form (paper) one of the question asks about the medical history of the patient with 7 available options( Diabetes, Cardiac, HIV etc). The 7th option is 'OTHER' and the patient is supposed to specify what Other refers to.

How can I translate this to an Access form?

I am thinking of a list of the 7 options, but when option 7 is selected; the user should be prompted to enter a specific disease.

QUESTION?
How can this be achieved, and how should the table be designed to accept this entry?


All help appreciated

Thanks

Will

View 2 Replies View Related

COMBO BOX : Specifying Item Not In List

Jun 22, 2006

Hi everyone,

I have a form with a field named TREATMENT with the following options :-

1 Cryotherapy
2 Radiotherapy
3 Chemotherapy
4 None
5 Other (specify)

If the 5th option (Other) is selected, the user is required to specify what 'Other' represents.

I have created a combo box with the first 4 options and in instances of 'Other' the user can enter specific treatment that is not in the list (1 to 4).

What I would like to do is whenever the user enters a value that is not on the list (1 to 4), I would like to insert the word OTHER in front of the value entered. In other words all values not on the list will be prefixed by 'OTHER'.
E.G. if 'Surgery' is entered, I would like the value 'OTHER : Surgery' to be stored in the Treatment field of the table.

This will help in the generation of statistics from the table.

Any suggestions??

Many thanks in advance.


Will

View 3 Replies View Related







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