Forms :: Change Recordsource On A Subform
Mar 13, 2014
I know this is probably already in the forum but it is getting pretty big and I can't find the answer. I have this:
frmMain frmMainSub frmMainSubSub recordsource = query1
How do I change query1 to query2?
View Replies
ADVERTISEMENT
Sep 4, 2006
I have a form with 5 tabs. Each tab has 2 subforms.
When the form loads I am trying to select it's recordsource by doing this:
Me!Subformname_A.RecordSource = "SELECT FieldA, FieldB FROM TableA WHERE"
However, it throws an error.
Is there something wrong with this ?
View 1 Replies
View Related
Sep 26, 2005
I have a report that can be used for 3 different queries. I've been trying for the last hour or so to get three different buttons on a form to open this report but give it an appropriate record source.
I figured there's got to be a way that's easier than three queries, and three reports...?
I was trying to use the same format as with forms :
[Reports]![rptReportName].recordsource = "qryQueryName"
or variations of that. Am I way off? It keeps saying that I've misspelled the name or it doesn't exist.
View 7 Replies
View Related
Jan 15, 2006
Hi,
I want to write Visual Basic language in the form with one button:
I have one form named "setForm" with one button and one text box:
Let's set the new table "frm2", the new form "frm2"
Dim sql As String
sql = "SELECT [model].* INTO frm2 FROM [model]"
CurrentDb.Execute sql
DoCmd.CopyObject CurrentDb.Name, "frm2", acForm, "frm1"
Forms!frm2.RecordSource = "frm2"
The last statement code doesn't work: It is said that Microsoft Access cannot find the form "frm2" referred to in a macro expression or visual basic code.
How can I change the recordsource? Thanks.
View 1 Replies
View Related
Sep 27, 2006
I have a form that is based on a query. I would like to change the form's RecordSource to another query using SetValue in a Macro.
Under Action Arguments I have
Item: Forms![Receiving Query subform].RecordSource
But I don't know what to put for an expression. I would like to use the same form but base the RecordSource on a query called "Receiving Search by Date". :eek:
Steve
View 4 Replies
View Related
May 27, 2005
Good afternoon
I have been helped out so many times in the past here I thought I would try my luck again.
Is it possible with the use of option buttons to change the row source of a listbox?
I want to use the listbox for a search criteria and thought it might be easier to have 1 listbox been updated from the choices made using a group of buttons.
I would like like the row source to be based on different tables maybe I might need to use queries.
Can anyone point me in the right direction?
View 6 Replies
View Related
Aug 18, 2006
How do i make my subfrm record source switch to another saved query (qryPendingStatus) when it's opened from the form.
Heres what i am trying to accomplish:
I have a subfrm that i'd like to use to display info in 2 different forms.
There's a form currently for All statuses. Then another new one for Pending status. I'd like to use the same subform for this pending status form also, and in doing that my qryAllStatuses, but change to qryPendingStatus on the subfrm when i open the mainfrom.
This is on the open even ofthe mainform, but does not work (says method not founds...so obviouly i can't use ".Recordsource" here:
Private Sub Form_Open(Cancel As Integer)
Me.subfrmJobInfo.RecordSource = "qryPendingStatus"
End Sub
How can i make this happen?
View 3 Replies
View Related
May 30, 2005
Hi everybody,
I have a form with its tabbed subforms' recordsource determined by the code:
Private Sub childTvl_Enter()
Me.childTvl.Form.RecordSource = "SELECT * FROM tblTvlInput WHERE tblTvlInput.Dept = """ & Forms.frmBudget.txtDept & """"
End Sub
This is to filter the huge data by department and only allowing the specified department to view their code. However, I find it slow and pesky as it only shows the required information when the user clicks on the child. I have tried putting the code above elsewhere but to no avail.
Is there a better way of speeding the filter as well as showing the user his own records when he clicks on the tab?
Thanks in advance. =)
You guys here are saviours!
View 3 Replies
View Related
Apr 18, 2005
Weird yet aggravating problem.
I am trying to setup a routine that will allow the user to change the RecordSource of a subform. The RecordSource is being changed yet once I move to another record the subform is reverting back to the original subform RecordSource. I am using the below command to change the subforms RecordSource...
Me.MySubformName.Form.RecordSource = MySQL
I even to make a copy of the subform and I changed the table it is linked to yet I got the same result
Me.MySubformName.SourceObject = "MyOtherSubForm"
There are no functions in the record selectors that would interfere with the subforms RecordSource.
Any suggestions as to why the RecordSource of my subform will not "stick" when I move to another record?
Thanks in advance for your help!
View 8 Replies
View Related
Jun 29, 2005
Hi
I have problems working with a 3 level form
I have one main form called Projects
Depending on the record on the form Projects, the subform called Products will display the correct info
And on the OnCurrent event of the form Products, it will display the correct info for another subform called Product_Info
The problem is, the subform called Product_Info is dependant on a field on the Projects form, and on a field on the Products form so I cannot directly link the Product_Info form with either the Projects of Products form
What I'm doing is changing the recordsource of the Product_Info subform on the OnCurrent event of the Products subform but for some reason it won't work
If I display the recordsource of the Product_Info subform, it displays the right recordsource triggered on the OnCurrent event of the Products subform, but the data doesn't display
Thanks
View 3 Replies
View Related
Jul 25, 2006
Hello,
I have a dropdown menu which has a lisrt of dates (mmm yyyy), and when one is selected it updates 2 boxes with 01/mm/yyyy and 30 or 31/mmm/yyyy
Private Sub cmbDate_AfterUpdate()
Me.frmData.Form.RecordSource = "SELECT * FROM qry_NatxReg WHERE [Company Name]='" & cmbCompanyName & "' AND [Time of Attempt 1] BETWEEN #" & txtDateFrom & "# AND #" & txtDateTo & "#"
Me.frmData.Form.Requery
End Sub
When i choose June, it works fine and gets all the june dates from [Time Attempt 1]
But when i Choose July, it includes June.
I only have data for June and July as it's still in testing.
I can't wrap my head round it!!
View 12 Replies
View Related
Apr 25, 2014
I have a mainform with a listbox and a subform sitting in the mainform. The default view of mainform is single. The listbox displays a list of people. When the user clicks on a row of the listbox the subform shows detailed data about that person. The layout of the subform covers almost half of the area of the mainform. It works except that the subform automatically takes table view as if there were many records to display although it displays only the selected record. This automatic manipulation of the default view does not look good at all.
View 12 Replies
View Related
Sep 24, 2013
I had a subform to enter payments. It worked well. The master and child fields linked well and all the necessary data appended to a new record in the payments table.
Now to make it more user friendly, I changed the subform to a popup form (The 2 forms took up too much real estate on the screen).I deleted the payments subform and created a command button to open the payments form as a popup.
I need 3 fields on the payments form to be populated from the edit sponsor form (sponsorID, MemberID, SponsorTypeID) and then payment details to be entered and posted to a new record in the payments table.Since I've changed the payment form from a subform to a popup form, the master/child relationships are gone and the 3 fields I need for the payment record no longer appear.
View 1 Replies
View Related
Aug 3, 2015
I am currently developing a crude Contact manager database and need a quick way of entering data into a selection of records (around 1000 at a time). At the moment I am manually going through all records and changing the "DateLastEmail" field manually, which can be very tiring.
Any way to assign a button to change the field for all records to today's date or something of the like.
Currently I have a form which filters my subform. The subform resides as a seperate query and when the "Apply Filter" button is pressed it requeries with a change of .filter property, so I guess that all that needs to be done is to change all records that exist within the query, but I am stuck on a way to do this without manually entering it.
View 3 Replies
View Related
Nov 24, 2005
Is there a way to set the recordsource for a form before it opens? I've got Me.recordsource = "QryNewCaseForm" on the On Open event of the form but I toggle between recordsources once the form is open and if I close it while the recordsource is "QryCaseForm" it won't open as "qryNewCaseForm" the next time I open it.
View 2 Replies
View Related
May 6, 2013
All. using 2010. I have a form and a subform. my master and child links are set but when I scroll thru my form; my subform does not change to show the matching records. I do have an unbound search field for the same field as the master and child links. When I type in the search field for a record; the subform does change to that particular record. Do you think that has anything to do with it?
View 1 Replies
View Related
Jan 7, 2014
I have a recordclone combo box for navigating between 240 company records, so the form will go to the correct record on updating the combo. Instead of clicking on the down button and scrolling through the list, I would like to enter letters into the box and update the record source automatically as I enter them.
I'm not sure what events to use since there appears to be very subtle differences between them (eg between 'on dirty', 'on change' and 'before update').So when I type in 'T', only those companies that start with 'T' are viewed in the combo box.I have discovered the VBA 'dropdown' command which would be useful for the user.
Code:
company.dropdown
Table_Company
Company_ID: autonumber
Company_name: text
The name of the form is "form1" and the combo box name is "company".The record source for the combo box is "query_company". In the form the ID field is hidden and the company name is not hidden.The criteria I have for the combo would be something like this.
Code:
SELECT Table_Company.Company_ID, Table_Company.Company_name
FROM Table_Company
WHERE (((Table_Company.Company_name) Like [forms!]![form1]![company] & "*"));
View 3 Replies
View Related
Nov 5, 2014
so I have a commandbutton on a form, when I click on the button I would like an inputbox that lists the subforms and subforms recordsource/ controlsource.
View 4 Replies
View Related
Apr 5, 2014
I have a query that I am using as recordsource for a form. I also have a list box that I am using to change records on the form.
My issue is I need to use the same form for similar queries. For example, I want to open the form with only "Manager1" records displayed. So I need to do a different query. I don't want to use parameters or have employees type the manager in. It needs to be just a button they click.
So my two options are - make 10 copies of the form each with their own new query recordsource for each manager, or use one form and dynamically input the recordsource before the form opens..
I want to do that -- but when I try the list box gets all screwed up. Because the list box is relying on another SELECT query to populate. I have 10 buttons each with a different recordsource query feeding into the form when I click but I get so many errors in the fields when the form opens.
View 3 Replies
View Related
Mar 25, 2014
I currently have a Job Management System where the Customer Order Form displays all jobs via a main form and an order details subform. This form is used for inputting new jobs and for viewing existing jobs via links from other reports such as a job schedule or customer orders report. It is always reached via a clicking of a "New Customer Order" Button where the form is filtered to new record or via double clicking on an order number in another screen and filtered via the order number.
I am now in a position where the database is growing too large and I want to archive the data in the Orders / OrderDetails Tables into Financial Years and put them in a separate backend database. However the jobs will still need to be viewed via the customer order form in order for them to be duplicated the following year.
I have created a union query of the PreviousFY and Current Orders to allow the "search jobs by customer" query to work. This works fine, but I now need to make the record source of the Customer Order form dynamic.
I have created a CurrentFY query to feed the form if it is a current job and a PrevFY query if it's from the previous FY.
I have written code to check the OrderDate against the financial year to work out which database the job is from and set recordsource according to that result. This is currently in the OnCurrent event as I also have other code there that checks details of the order to determine if fields should be editable.
However I am finding that when I parse the order data between the forms the "new record" command or the order number is not being retained or checked. If this because I don't have a recordsource set when it opens?
I tried setting the recordsource as the currentFY on open and then do the check but that didn't work.
View 1 Replies
View Related
Mar 14, 2013
I am assigning a recordset using vbs code. The variable "CB_proj" is a combobox value. The problem comes when the combobox is null, the program errors out and even if I try to exit the routine with an if statement, it still compiles the line of code and errors out because the object doesn't exist. how I can get it to not compile that error if my combo box value is null?
CB_proj = Forms!CC_MAIN.CB_proj
strSQL = "SELECT " & [CB_proj] & ".* FROM " & [CB_proj] & ";"
Forms!CC_MAIN.projdat.Form.RecordSource = strSQL
Forms!CC_MAIN.projdat.Form.Requery
Forms!CC_MAIN.Form.Requery
View 3 Replies
View Related
Dec 18, 2013
I didn't have this problem when I had used subforms, but there were little bits of thins I had to polish. There are basically 2 tables, and the form is based on the table PKing. It shows the PK and a few irrelevant fields. However, when the recordsource now inner joins the two tables based on the PK, it only turns up 1 record.There are no filters, and nothing is spelled wrong. I checked all of the control sources, and nothing's off. What am I doing wrong?
The one record that is shows is perfectly fine.
View 7 Replies
View Related
Mar 9, 2013
I've got a DB, which has 3 forms ( all 'under' 3 navigation buttons/tabs ). The main form ( Client's form ) is set to show first, and currently has a recordsource of about 1350 records. I think the size of the recordsource, and the fact it 'loads' the other two forms all 'in one go', is slowing it down ( between 5 and 10 secs. to load ).
I read I should set the Visible properties of forms, not shown immediately, to false, only setting them to True in the On_Load event - when Tab is selected. Ideal I thought. However, I can't find this property in the Form's property sheet.
View 1 Replies
View Related
Feb 16, 2014
I have a simple add form that will add an entry to one of two tables: Box 1-1, or Box 1-2.
They have the exact same fields. In the add form, I want the user to specify a Rack field and a Box field. Box 1-1 would be Rack 1, Box 1. Box 1-2 would be Rack 1, Box 2 (there will be more tables later, but just using two for now until I get it working).
But right now my form always adds to the table Box 1-1 - I can't get it to switch.
I've added the code I have so far below. The first part is what I'm having trouble with, the second part just uses a Submit button to add a new record - I'm just including it in case it's interfering in some way I'm not seeing. I'm running Access 2007.
Code:
Private Sub Switch_BeforeUpdate()
If Me.Rack.Value = "1" And Me.Box.Value = "1" Then
Form_Add.RecordSource = "Box 1-1"
ElseIf Me.Rack.Value = "1" And Me.Box.Value = "2" Then
Form_Add.RecordSource = "Box 1-2"
[Code] ...
View 7 Replies
View Related
Nov 12, 2013
I have a form with a (large) number of controls which acts as a kind of read-only dashboard of data. The data is split across a number of tables (4, for now, but may grow) I've created a query which amalgamates all of the data from the tables into a single dataset and set that as the RecordSource (Snapshot) of the form. I now want to bind each of the controls to a particular field returned by that query.
However - I have a combobox (same form) which allows users to select a date and I need the controls to update with the relevant data for that date whenever the combobox is changed. The query already returns values for each field over a range of dates so the data is available within the form's RecordSource - I just don't know how to include the date criteria, as specified by the combobox, when binding each individual control?
View 2 Replies
View Related
Apr 5, 2014
I am trying to change the button color on a subform if a related form data changes.Main form is products with a continuous subform with serial numbers of products i.e, serial number, location, price and a button to add addtional issues if there are any for this particular serial number (this will open up another form related to the serial number so I can add an issues if there are any).The reason I would like the button to be a different color is so I can quickly see if there are any additional notes been added to the serial number. Just in case you may ask why not add the field to the continuos form is that the issues and be quite lengthy and there may be lots of serial numbers on the form
2346 location warehouse price 29.99 (button - green)
2347 location shop price 29.99 (button - red)
View 1 Replies
View Related