Problemns Accessing A Subform From A Mainform
Feb 8, 2006
Hi,
I had a text box on a main form linked to a text box on a sub form using the following control source =Forms!Form![frm_Doctors_details subform].[Form].[Title]. This was working, however I had to play around with the subform alot and now the link isn't working. All i get in the field is #name?. Nothing has changed on the subform textboxs, just that I added a primary key to assist in the linking action bewteen forms. I can't for the life of me get it back to what it was . any ideas??
Thanks in advance
View Replies
ADVERTISEMENT
Apr 2, 2008
Hi there guys,
Im in a bit of a predicament, I have a main form with 3 subforms named:
Debit/Cred income for day subform
Cheque income for day subform
PDC income for day subform
and in each of these subforms, I have a field/text box (From a query) which is called "SumOfTotal Cost"
and also in the mainform I have another field/text box called "text73"
Now, all I wanted to simply do was to add all of those fields mentioned together to display them on the main form in another text box as a total so I tried to use this expression in the control source:
=Me!Text73+Me![Debit/Cred income for day subform].Form![SumOfTotal Cost]+Me![Cheque income for day subform].Form![SumOfTotal Cost]+Me![PDC income for day subform].Form![SumOfTotal Cost]
But when i open the form, the text box just appears saying
"#Name?"
I then tried to put brackets at the ends of the code, but still nothing would work, I then tried to access each individual "SumOfTotal Cost" by putting the following in a text box:
=Forms![Cheque Income For Day subform]![SumOfTotal Cost]
but it still comes up with "#Name?".
I am pretty annoyed and I would really appreciate it if someone could please help me
Thanks a lot
View 14 Replies
View Related
May 1, 2005
I have a main form with a control that can take one of three values. And I would like to add a subform that work as follows.
Selecting each value should change what the subform displays like this.
Control Subform
A Select * from TableA where Key = "A"
B Select * from TableB where Key = "B"
C Disable subform somehow because it doesn't apply
Could someone please provide some advice on how I could do this.
Thanks
Fearless
View 1 Replies
View Related
Jul 5, 2005
Hi,
I am assuming Access cannot handle Many to Many relationships very well.
I have an Account form ("MainForm") with an embedded SubForm that displays only the Account Address with suite number, street number, street name, street type. Account to Address is a Many to Many relationship. My Account form's source is tblAccount, and the SubForm is built off of a query of 3 tables -- Querying Account, LinkTable, and Address table. The link between the SubForm and the "MainForm" is done via AccountID.
My problem is, when I query for an Address (say entering a street number of 25), I want to get back all the addresses with street number of 25 AND the corresponding Accounts that have street number 25 only
What it does is return the addresses with Street Number 25 and ALL the accounts regardless of what their addresses are!
Is there a way to do this?? Can I design a form without using a SubForm in this case, ie, display the account and its many addresses? Or does Access Forms not support Many to Many Relationships? I'm thinking the link table is causing the problems here.
Please advise -- this "simple" project is becoming quite the headache! :eek:
"edit" -- I also notice this problem with a 1 to Many relationship (the "many" portion being the subform)
Thanks for any help,
Mike
View 3 Replies
View Related
Dec 13, 2006
Hi,
I want to open a subform programatically with a 'linkcriteria' filter.
However, What i am experiencing is just the subform opening without the main form.
How can I open the subform on the appropriate record and the mainform as well, as one??
Thanks
View 3 Replies
View Related
Mar 9, 2005
Hi,
i'm working in access 97 and am having difficulties pulling a subtotal or referencing any fields on my subform on my main form. I've searched the forum and help and tried to apply the info provided, but i still can't seem to get it to work.
as far as i can tell this should work:
=[MySubForm].[Form]![TxtTotalStaffNumbers]
but i'm still getting the dreaded #Name? error.
anyone got any clues as to what i'm doing wrong?
what about the case where the subtotal i'm referencing is a calculation such as =Sum([Quantity]*[FacilityArea]). Should i still be able to reference it on my main form by pointing to the name of the field?
Thanks very much!
View 3 Replies
View Related
Oct 8, 2006
Hi,
I have a query (SelectedData_Query) , on which a form (SelectedDataQuery_SubForm) in datasheetview is based, which is placed on a form (NAWInvoerForm) where customer adress data is put in. When someone clicks new case button on the NAWInvoer_Form, another form (CaseDateTimeInfo_Form) is opened, data is entered, but when the "CaseDateTimeInfo_Form" form is closed, the data in the subform in datasheetview on the NAWInvoerForm is not yet refreshed. So I tried the following:
Private Sub Form_Close()
'------------------------------------------------------------
' RefreshNAWInvoerForm
'
'------------------------------------------------------------
On Error GoTo RefreshNAWInvoerForm_Err
DoCmd.OpenForm "KlantNAW_InvoerForm", acNormal, "", "", , acNormal
DoCmd.RunCommand acCmdRefresh
RefreshNAWInvoerForm_Exit:
Exit Sub
RefreshNAWInvoerForm_Err:
MsgBox Error$
Resume RefreshNAWInvoerForm_Exit
End Sub
Which works just fine. After the form is closed, the name, adress and cases overview form is reopened and refreshed, thus the case that has just been created is shown nicely in the subform which is based on a query.
But it is starting to become bothersome, sometimes when I close the form in which I create a new case, I don't want to have the other form (NAWInvoerForm) reopening again.
So how can i make it so that when I close the form only the data in the "NAWInvoer_Form" is refreshed, without having to reopen the form again. I mean, in the background, the form is still open anyway. It just shouldn't keep popping up everytime.
It can't be hard, but I can't see it. I'm new at this. I have found some similar topics on this forum, but none which helps me out enough.
It should be something like:
On "thisandthatevent" do a "thisandthatcommand" on "thisandthatsubform" in "thisandthatform"
If I know how the syntax of that is done, it would help me out with some other problems I see coming in the near future. I've looked at, and tried some things based on this link: http://www.mvps.org/access/forms/frm0031.htm
But without success.
Can anyone help?
View 4 Replies
View Related
Jun 25, 2005
May be this is easy for your guys. I want to freeze or lock the mainform data fields while allowing users to input, edit, delete data on a subform. I tried to change mainform properties so it can not edit, add or delete data on mainform. By doing so, I cannot do anything with subform, it seem read only as well.
Thank you for help
Peter
View 1 Replies
View Related
Jul 28, 2014
My Database is really simple, it contains 1 table (called Querys) and a form called Dashboard.
In my main form (Dashboard) I have inserted a sub form which shows all the records in my table (called Querys) when I use my main form and add a record this sub table can then be refreshed and it shows all my records.
This part is fine,What I would like to do is be able to select a record in my sub form and it show the record data in my main form. This would really speed up the navigation process as the database gets bigger.
View 3 Replies
View Related
Dec 13, 2013
I have a form which shows training events - these can take place over one or several days, and can be run by one trainer or several, so I have my basic Events Info in one table (EventID, EventType, Location, that kind of thing) and the 'Jobs' in a separate table (EventID, JobDate, TrainerID, etc)
The problem I'm having is that I want the List of Events to be sorted in order of their start date... which is on the subform, not the main form.
How can I go about it - and still leave both the main and subforms fully editable?
View 12 Replies
View Related
Jul 25, 2013
I'm having issues with this one.
Table name is CompDates
Subform is ViewByMarket
Start date is Text13 and End Date is Text15.
I want it to filter out any matches between the 7 fields. Here is my code:
Code:
Private Sub Command19_Click()
Dim strFilter As Variant, _
strSDate As String, _
strEDate As String
'check Text13
Text13.SetFocus 'set focus to Text13 to be checked
[code].....
It will only filter for Build Date 1 and not for any of the other fields.
View 1 Replies
View Related
Jul 22, 2014
In open Mainform event
Forms!Mainform.Form!SubForm!controlname.columnhidd en = false doesn't work. Ms Access can't find "subform"
On load and open events in subform doesn't work with columnhidden. (no reaction)
View 7 Replies
View Related
Nov 25, 2014
I have a Mainform [FrmReconcileMain] and it contains a Subform [FrmReconcilesub]
What I'm trying to is, on the Main form type in a statement date in textbox [TxtStatementDate].
I have a checkbox on my subform [ReconciledYN], along with a textbox [TxtReconcileDateSub]. when I click the checkbox, it simply pulls the date from the mainform and populates the date in the subform.
I've even tried experimenting on a simple form (with no subform) to see whats going on, but still I can't get it to work, even on a simple event such as this...
If [yourcheckboxname] = -1 Then [controlnametoupdate] = date() Else [controlnametoupdate] = ""
View 13 Replies
View Related
Dec 16, 2013
I'm having a problem with the syntax of a recordset of a Datasheet inside a subform which is also inside a Main Form.
Main Form - frm_1_0_LMS
Subform - frm_1_4_0_TeamApprovals
Subform(Datasheet) - frm_1_4_1_TeamApprovalsList
Here is my code:
Code:
Dim rs As DAO.Recordset
Set rs = Forms!frm_1_0_LMS.frm_1_4_0_TeamApprovals.frm_1_4_1_TeamApprovalsList.Form.Recordset
If Not (rs.EOF And rs.BOF) Then
Forms!frm_1_4_2_ApproveDeclineUserLeave.Controls("lblFiledDateLeave").Caption = rs!Leave_Date
End If
I am getting this error: Object doesn't support this property or method
View 1 Replies
View Related
Mar 28, 2005
I have an access db and I want to access the subform on
one of my forms. Can someone help me with the syntax
to access these forms.
I tried this but it did not work.
Code:formname.variablename
View 1 Replies
View Related
Jun 29, 2006
Hi!
I want to access individual rows in a subform (frmOrderdetails (datasheet view)).
The reason for this is that I have a checkbox at the end of each orderline, and user will be able to check individual lines and do a return of these lines.
For now, I have a query to return lines, but the problem is that when there are two lines checked, it'll only return the first one.
Anybody that knows how to obtain this?
:-)
Thank you!
View 6 Replies
View Related
Feb 19, 2006
Glad I found this forum.
First question as user :)
I have a database I am creating with a number of subforms. A few of the subforms I want to be able to quere data from a ODBC connection. When I use the combobox to select a system, the subforms with ODBC connections are not updated. I will not be updating any of the data on the ODBC.
Should I just create a macro that does a delete quere and then make-table quere, or is there a better way?
thanks
brandon
View 1 Replies
View Related
Sep 23, 2005
Hi:
Have a employee timesheet application.
I have a form based on tblEmployees table, key Employeeid
Subform1 on that form based on tblWeekStartDate table, key weekstartdate and employeeid. I created 100 entries in this table for each employee so they can pick a week from combo box to enter their hours.
Subform2 within above subform1 based on tblTimeCard with key autonumber field.
When I click a button on main form I want to print preview a report of the form using EmployeeID from main form for critieria for main report and startweekdate field as critieria for subreport.
I'm unable to access the field weekstartdate from subform1 for the criteriea of the subreport query. Weekstardate is in the header of subform1.
In subreport query I'm using for weekstartdate criteria:
Forms!mainform!subform1.form!weekstartdate and query ignores it.
I also created an unbound textbox on mainform with:
=Forms!mainform!subform1.form!weekstartdate
thinking if I could get the subform1 value onto main form then the criteria in subreport query would access it but get #Name.
I did create a dialog box form where when clicking the print button on main form they can pick weekstartdate from dialog form and works fine. It does not make sense for the manager to pick a weekstartdate on the main form and then have to pick it again on dialog box.
I've attached the database. When the main form opens click on the report button.
Thanks!
Steve
View 3 Replies
View Related
Jun 13, 2005
I have a form containing a subform.
Inside the form, i set up a button. Inside the OnClick code of this button, i need to access the information inside the subform.
To access the info inside the form, i know:
Me.Fieldname
But inside the subform, i have tried:
Me.SubformName.FieldName
or
SubformName.FieldName
And both did not work.
How can i?
View 2 Replies
View Related
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
Sep 25, 2006
Ohh Stress. Need Help....I have a mainform that contained two subforms in it. MainForm called "Employee", the two subform called "vac", and "Prevac". There is a field in my mainform called "Hours", that I'd like to use to Add with a field in Vac subform called "VacA" and a field in Prevac called "FHours". I'd like to display the total (sum of all three field on the same mainform. Is there anyone have any idea? Thanks in advance...
View 3 Replies
View Related
Jan 9, 2006
Would like to be able to update a text field on the main form with information from a dropdown box on a subform when the subform data equals a certain value. Would like the main form field to update as soon as the subform information is selected from the dropdown box.
Example (sorry don't have code for it)
Mainform field = Mytext
Subform dropdown field = Newtext1, or Newtext2, or Newtext3
If Newtext2 is selected on subform, I would like Mytext to immediatly show the value in this field (mainform/mytext). Do not want either Newtext1, or 3 to ever show in Mytext but want it to remain in subform field
It can either be on Lostfocus from subform or onupdate from subform, etc.
Whatever works best/easiest
Thanks for the help in advance
View 1 Replies
View Related
Jan 9, 2006
Would like to be able to update a text field on the main form with information from a dropdown box on a subform when the subform data equals a certain value. Would like the main form field to update as soon as the subform information is selected from the dropdown box.
Example (sorry don't have code for it)
Mainform field = Mytext
Subform dropdown field = Newtext1, or Newtext2, or Newtext3
If Newtext2 is selected on subform, I would like Mytext to immediatly show the value in this field (mainform/mytext). Do not want either Newtext1, or 3 to ever show in Mytext but want it to remain in subform field
It can either be on Lostfocus from subform or onupdate from subform, etc.
Whatever works best/easiest
Thanks for the help in advance
View 1 Replies
View Related
Jun 2, 2005
How do I implement a db with a MainForm and several ChildForms (which contain subforms) and each form sourcing data from its own table (MainForm-MainTable, ChildForm1-ChildTable1, CF2-Ct2,... SubForm1-SubTable1,...). There are buttons in the MainForm to navigate to the ChildForms. How to link, relate or make the db work, so that the every record from the MainTable has an related record in the ChildTable?
thanks in advance...
View 1 Replies
View Related
Dec 21, 2005
I have a form called “frm_TrainingLog” based on “TrainingLog” table. This form is continuous and tabular – I need to have it this way. In the header of this form I’ve created a listbox called “QuickSearch” which displays staff details i.e. StaffID, Name etc.
The mainform and the listbox are linked using the following code:
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[StaffID] = " & Str(Me![QuickSearch])
Me.Bookmark = rs.Bookmark
The above code does partially work and selects the right record in the mainform but it doesn’t filter out rest of the records which are not equivalent to selected StaffID from the listbox.
I could really do with someone’s help….thanks
View 2 Replies
View Related
Aug 22, 2006
Hi!
I have a mainform, with a popupform, on which I want to select a record/post
to work with on the mainform. I have managed to select the actual post on the popup, but i dont know how to make the mainform navigate to that form.
How do I easiest accomplish to make the mainform navigate to the record I've selected on the popupform?
thanks for your reply ;)
View 3 Replies
View Related