Always Use A Query To Fill A Subform?

Mar 2, 2006

Hi everyone

I've seen a number of threads here, as well as elsewhere, which suggest that it's good practice to use a query to provide data to a subform, rather than placing data directly from the table.

I can understand the need for this if a special function of the query is needed, such as selecting certain records, performing calculations with some fields, reordering the information etc., but what if the data is to be transferred without any such manipulation? Is it still better practice to put the data through a query (that simply takes all fields from the table and doesn't modify anything) or take it directly from the table to the subform?

My "gut" feeling is that it wastes time (albeit a fraction of a second!) to have an extra step between the table and subform and, I suppose, another step where something could go wrong.

Is my logic correct, or is it ALWAYS good practice to use a query to supply data to a subform. If the latter, I will change my practice and use more queries.

Thanks for your responses.

View Replies


ADVERTISEMENT

How To Fill A Subform Based On A Different Subform

Mar 16, 2006

I have two subforms on a form. When the user clicks on the 1st Subform the 2nd one will populate depending on what was selected on the first one. I have a click event but the 2nd subform isn't being populated correctly.
Is this possible?

View 7 Replies View Related

Auto Fill In A Subform?

Aug 9, 2005

Here is what I have so far. Table 1 has employee info. Table 2 is for the courses that employees take. Table 3 is a listing of available training courses. What I have done is created a form with all the employee info and linked it to table 2 by ss #'s. What I am wondering is if I can create a field, lets say course #, in table 2 and table 3. That way when I input the course number into the subform, then the corresponding info from table 3 is inserted, ie course name and course hours. Any suggestions or help would be great.

View 1 Replies View Related

To Fill Subform And Then Go To New Record

Dec 31, 2006

Hi All,

I have little problem, Please solve for me. Thanks

I have form contain with the subform (Datasheet). I want to fill subform from another form "that form have list Box" when I dubileClick on the record in the list box, the record move and add in the subform. till here ever thing is fine. But it does not go to newrecord "(not move to the next new row)" that I want to fill again from that form's listbox. I used "Docmd. gotorecord, , acnew. but did not work

Please try to get me out this problem. thanks
:)

View 1 Replies View Related

Forms :: Fill Field On A Subform From Another Form

Apr 2, 2014

I have an order form with an order details subform. When the user enters in a part number the description and selling cost are auto filled.

Sometimes the user will change the selling cost on entering through the record. Problem is that the users are entering through these records again and changing back the changed selling cost to the set one on the part.

I've created a form to open if a part was sold to the customer more than once so the user can see the last selling price.

I'm trying to auto fill the cost field with the last cost change but am at a wall.

Also there can be more than one cost change so I need the most recent to auto fill the subform details selling cost.

View 2 Replies View Related

Pulling Data From Previous Record To Fill Subform

Dec 4, 2012

I have a subform that is embedded in a main form. The database itself is a few years old and so I think redesigning is out of the question. What I am wondering is if there is any specific code that can go into the tables themselves and populate the form based on the previous record. I would like for the Transfer to Rehabber fields (To and Permittee) to be duplicated on the Transfer From Rehabber fields (From and Permittee) on the next record. Do you think that there is code that will be able to achieve such a thing?

View 12 Replies View Related

Modules & VBA :: Automatically Fill In A Textbox On A Subform On Button Click

May 4, 2014

I have a mainform with a combobox and a button. What i want is when i click on the combobox and then on the button I want that the textbox in the subform automatically fill in.

The mainform name is FrmTakenInvoerenEnToewijzenAanEenMonteur,

The combobox name is Keuzelijst1,

The subform name is SubTakenInvoeren,

And the textbox name is txtOpdrachtnr.

I tried this code in on button click:

Me.SubTakenInvoeren.txtOpdrachtnr = Me.Keuzelijst1

But that doesn't work.

View 7 Replies View Related

Forms :: Fill Datasheet Subform Based On Selection In Parent Form?

Dec 6, 2013

What I have is a form that takes in information regarding test data. Each test run can record data for multiple requirements. I am able to pull all data fine, however in order to make it easier on the user i was hoping to populate the requirements subform based on a selection of "test group" in the main form.

Commonly run together requirements can fall in to groups. I have a selection box for these groups in the main form and a table that stores these group id's and group setup. Is there a way to autofill the tables records that the subform is linked to based on the selected test group?

View 3 Replies View Related

Having Some Subform Fields Auto Fill From Mainform Fields

Nov 2, 2005

How can I get some mainform fields' data to be the first entry in a subform? From the mainform, I would like the Head of Household name and date of birth to be carried over to the first entry in the HouseholdMembers subform.

The two forms are tied to separate tables. For each household member I need to be able to enter full legal name, date of birth and some additional pieces of information such as income and source of income.

What I'd like to avoid is making the users enter the Head of Household's name and date of birth twice. Is there a way to carry that information over to the subform?

Thank you, Charlotte

View 14 Replies View Related

Forms :: Data From One Field To Fill In Field In Subform

Nov 26, 2013

I am doing this all as a bound form

My main form got a field named 'PersonID'.

My subform also got a field called 'PersonID'

The subform 'PersonID' populates however the mainform 'PersonID' does not.

I just need to write code, or maybe do something that will copy the number from subform and paste it in the mainform field, maybe at the click of my save button.

View 8 Replies View Related

Can You Fill A Text Box Using A Query

Feb 24, 2006

Hi, newbie needs help!

I am trying to make a courses registration database. I have 3 tables; tblContacts [ContactID], [FitstName], [LastName] [Etc..] [Etc..]
tblCourseRegistration [RegID], [ContactID] [CourseID] and tblCourses [CourseID], [RegID], [CourseName], [StartDate], [AvailablePlaces]
I have created a form called Test1 that displays The CourseID, CourseName, StartDate EndDate and an unbound textbox called PlacesLeft. I would like to display in this text box the number of places that are still available on a particular course. I've written a querie that counts the CourseID's in the course registration table this works ok but I want it to place the value in the PlacesLeft text box. Then I can do a simple calculation based on the PlacesAvailable textbox. Anyone any idea how to do this My querie reads
SELECT Count([CourseID])
FROM tblCourseRegistration
WHERE (((tblCourseRegistration.CourseID)=(Forms.Test1.Co urseID)));

I tried another method which includes a command button that when clicked tries to run the following
Dim MyRS As ADODB.Recordset, strSQL As String

Set MyRS = New ADODB.Recordset
strSQL = "SELECT Count([CourseID])FROM tblCourseRegistration WHERE (((tblCourseRegistration.CourseID) = (Forms.Test1.IDNo)))"
MyRS.Open strSQL, CurrentProject.Connection, adOpenKeyset, adLockOptimistic

If MyRS.NoMatch Then
Me.PlacesLeft = ""
Else
Me.PlacesLeft = MyRS.Fields(0)
but Access (Ver 2000) does not like the noMatch and shows it as an error.
I would be very grateful if someone could show me how to sort this out!

Many thanks in advance

View 3 Replies View Related

Fill Form With Query Results

Feb 24, 2005

In the attached db (both 2K and 97 ver) there is one form. Fill in the Date with 12/01/04 and the Start with 12/01/04 and Stop with 12/31/04. Press the Run Query button. The query is displayed...

How can I do it so on button press the form is filled with the query results?

View 1 Replies View Related

Queries :: Fill In A Table After Running A Query

Apr 16, 2013

I have now a database where I made a query that will show me all clients I can charge when there is a end date and an account number mentioned. I have also in a table where I put if the client is already charged. This is a check box that gives me yes or no. Is it possible to run the query and once those selected show up, to also add a yes to the table so next time I run the query the ones charged will not be charged again.

View 5 Replies View Related

Queries :: Fill In Checkbox After Running Query

Oct 10, 2013

I have a query that produces a report for charges to the client. On the form I have a checkbox that when the client is charged it is ticked. What would be better is that when I run the query to export to excel, it should check all those checkboxes and the ones that are blank, fill them in (tick the box). Then I need to add to the query that that field should contain only blanks so it will show me only the ones that where not charged and then after producing the report check those boxes so it keep track of all the clients charged (to avoid double charge).

View 3 Replies View Related

Auto Fill Form From Query Results With Button

Feb 28, 2005

Hi all,
I've got another one for ya... I did a search, but must be choosing poor keywords because I can't find the answer I'm seeking.
Anyhoo, what I need to do is use a bit of information garnered from a database to fill in a line of fields on a form at the click of a button on a different database.
I have linked the table I need from the first database, and created the query that grabs the information I need to autofill. So far, so good. What I can't figure out is how to get this information to pop into the fields I want to fill.
I'd like to use a button with a click event to pass the data into each appropriate box (there would be 5 fields worth of info). I need to use a button because it won't always fill in the same line, which of course, adds to the complexity.
Can anyone point me in the right direction?
Thanks in advance,
Ceejay

View 2 Replies View Related

Queries :: Use Query Results To Fill In Records In Another Table

Aug 18, 2015

I have a query that outputs results like:

Company ID | Data A | Data B | Data C

101 | results |results |results
102 |results |results |results
103 |results |results |results
104 |results |results |results
105 |results |results |results

In another Table containing additional company information, I have the primary key as the company ID, and I want to make the query that outputs the above table, auto-fill the blank fields in the existing Company information with the same headings as Data ABC etc.

However, I don't want the query to add full new records (which I think is the Append Query?), instead I want the existing company records have additional fields (Data ABC) added, with information from the Query added.

View 1 Replies View Related

Forms :: Refresh Pivot Chart In Subform After Changing The SQL Of The Subform's Query?

Sep 16, 2014

I have a form, a couple of comboboxes and text boxes on it. When these are filled out, the SQL of a query is changed using these parameters.

There are three subforms on the form, all pivot charts, all based on the query being changed.

The goal would be to update all three according to the user-given parameters.

Right now the subforms only update if I close and open the form, which is probably not the best solution, since it's too slow.

I've also tried to requery and refresh them, with no result.

Then I tried to overwrite the recordsource of the subforms with the same text that was originally there. This got them to refresh their data, but then all of the charts disappeared and had to be built again, so this is a no go too.

View 7 Replies View Related

Allow To Fill IF

Mar 8, 2007

Hi,
I got a Date field[Provdate-ontv] which only is allowed to set if another field, a Yes/No field[Prov-ontv] is set to Yes (default is no)
How do I do that ??

View 2 Replies View Related

Auto Fill

Jun 8, 2005

I've tried googling this, but I can't find anything helpful. I have five columns in my 'Main' table. In each row, column B, C & D are solely dependant on column A. And column E is completely independant of all of them. I want to be able to select a choice in column A using a drop-down menu (which I know how to do) and have columns B, C, & D automatically fill themselves in (which I don't know how to do). Column E I would just manually enter.

How do I get columns B, C, & D to automatically fill themselves in my 'Main' table. I would select a value from a drop-down menu in column A and want everything else to fill in. The values for A,B,C,& D are all in seperate tables with an ID and linked to their respective fields in the 'Main' table. Appreciate any help.

View 1 Replies View Related

Auto Fill

Aug 14, 2007

Hi

Does anyone know how I can auto fill all the records of a field by just entering it once

Thanks

View 2 Replies View Related

Auto Fill

Jan 17, 2008

I am looking to find the experssion that will allow me to put a date in a query under date completed and have it fill another field for schedule.

I know that in Excel it would be =sum(A1 +90 ) and this will give a date 90 days after the date inputed into field A1 and so on down the column. and it would auto fill the next column for me

View 2 Replies View Related

Fill A Field With The Same Value

Apr 1, 2005

Hello,

I'm new to access and i need help in filling a certain field with the same value.
In fact i have data representing one quarter of data and i need to add a column called "Quarter" in which i paste the same value: the current quarter : "Q4".

How can i do that?
I think this is a real simple issue.

Thanks in advance for your help.
Regards
sam

View 1 Replies View Related

Fill In The Blanks

Jan 29, 2007

I have a table with three columns

Column A, Column B, Column C

in these 3 columns i have different values and in two fo these columns there are blanks. I want to search for this blanks and fill them in with a static value. But only the two columns.
How can i do this? Update Queries?

Thanks you

View 5 Replies View Related

Code To Fill

Feb 28, 2008

all I have this code that opens a table and fills in a blank field from the previous record.
Private Sub CopyField_click()
'Fill blank fields with previous record
Dim i As String

Set myDb = CurrentDb()
Set MyRs = myDb.OpenRecordset("ACHClosedAccts")
MyRs.MoveFirst
Do While Not MyRs.EOF
MyRs.Edit
For Each myfld In MyRs.Fields
If myfld.Name = "ClientNo" Then
If MyRs(myfld.Name).Value <> "" Then
i = MyRs(myfld.Name).Value
Else
MyRs(myfld.Name).Value = i
MyRs.Update
End If
End If

Next myfld

MyRs.MoveNext
Loop

End Sub
I need to use this code with multiple field names Where

myfld.name = "ClientNo"
I need it to also reference another field to do the same thing. Like:
myfld.name = "ClientNo" and "AcctNo"
It won't work with "And" or "Or". What can I do? I thought about an array but I don't know how to rewrite the code unsing an array.
Please help Thanks

View 1 Replies View Related

Auto Fill? Help Me Please!!

Sep 27, 2005

In using a form to input new information, I want to utilize the autofill feature, but I don't know how.

For example. When someone inputs a month, I want the season to be automatically entered in, in the following entry.

Can someone please give me some direction or help me to do this!?

:D Thanks!

View 1 Replies View Related

Must Fill In Textbox

Jan 2, 2006

Hi

I have created a form with one unbound textbox and a command button.

How do I make sure that the query only runs if text is entered in the textbox?
I do not want the command button to run unless the textbox has data to query.

At the moment the Query runs and displays all records.

View 3 Replies View Related







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