Focussing On A Subform Control
Jan 18, 2008
Hi,
how can i focus on a subform control? my main form called form A has a subform called form B. Form B has a button that, when is clicked, starts a new record for Form B source. all works ok while editing form B but when i open Form A and run the same macro, i get an erro saying Form B is not open.
my macro reads-
GoToRecord
object Type Form
Object Name Form B
Record New
the button is placed on form B which is sub form to Form A.
any help really appreciated.
Nigel
View Replies
ADVERTISEMENT
Aug 3, 2006
OK. I have searched and searched and every thread dances around similar situations but none seem to address this particular one. I am trying to make a control on a sub form visible/not visible depending on the condition of a control on a main form. The catch is that the control I'm trying to change the state of is on a subform located in a tab control. I've tried a thousand combinations and none seem to work. How do I reference the control on the subform in a tab control?
Main Form: frmMemberMain
Tab Control: TabCtl12
Tab Control Page: 2
Subform: frmChildren
Control on subform: txtRelationship
Can someone please help before my brain explodes!! Thanks! :eek:
View 5 Replies
View Related
May 27, 2014
On a main form i have a continuous subform listing Jobs.
On the Click Event i want to display the personnel and equipment separately in two additional subforms linked to the Job i have clicked on by JobID.
I have tried all sorts of references and currently have this:-
Forms!PersonnelAndEquipmentMovementFrm.PerEquipMov Jobs.JobID = Form!EmployeeSubform.JobID.Text
Which does not work?
View 4 Replies
View Related
Apr 26, 2005
I had a form with two tabs and then added a subform into a third tab. Until I added the subform I could see the tabs at the top in both the design view and the form view. However, since adding the subform, althougth the form looks OK in the design view, when I switch to the form view the tabs are missing. The only way that I am able to get to them is to tab through all my fields until it eventually seems to shift the page up and I can see them. If I switch to another tab and this stage I then have to go throught the same proccess of going through each of the fields until I can see the tabs again.
Hope this makes sense and someone can help!
Sam
View 2 Replies
View Related
Aug 22, 2006
How do you tab out of one subform and into another from the main form. I have 3 subforms and after a user is finished entering data into the main form the first subform sets focus. After data is entered into the subform it’s impossible to hit the “enter” or “tab” key to move onto the next subform.
View 3 Replies
View Related
Feb 25, 2006
I have two forms, ctrlpanel and users. ctrlpanel is acting as the main form and users as the subform. In a module, I have the following code inside a function that is called on in the users subform:
Code: With Forms![ctrlpanel]![users].Form!cmbSection .RowSource = strList .RowSourceType = "Value List" End With
Can't seem to figure out why I get this error. Have tried a couple different ways of doing this with the same result. here is the error:
"Microsoft Access cannot find the field 'users' referred to in your expression."
users isn't a field, it's the subform and the syntax above is how many sites show how to refer to the subform.
JMH
View 1 Replies
View Related
Nov 16, 2007
I have a subform on my main order form. I would like to click a button on my main order form and have it change a control on the subform. For instance, I have 2 controls on my subform, control 1 is a text field, and control 2 is a yes/no box.
When i click the button on my main for order form, I would like it to evaluate control 1 on my subform so that it can adjust control 2.
I would like to see if control 1 is null then set control 2 to yes or true. Thank you in advance for all your help.
View 4 Replies
View Related
Mar 1, 2005
This is probably simple, but I can't figure it out.
I have a table called Household that has a one-to-many relationship with a table called Individuals. The Individuals table has fields called FirstName and LastName. I have a main form based on Household. I want to have subforms in a Tab control based on the Individuals table. So when you click Page 1, it shows the data for the first person in the household, and when you click Page 2, it shows the data for the second person in the household. This would work by basing the subform on Page 1 on a query that finds the Min of FirstName, and basing the subform on Page 2 on a query that finds that Max of FirstName. However, the data in the subforms would not be updateable, because queries based on aggregate functions are not updateable.
Does anyone have any ideas as to how I can accomplish what I'd like to do?
View 5 Replies
View Related
Aug 9, 2005
I've use a set up that works fine on a form but doesn't when used in a subform. Basically, i have a check box and txt box that won't allow anything to be written in it unless the check box is checked. If it is checked and nothing is inputted in the text box, the lostfocus event for the txt box flags the user. It works fine in a normal form and when it's a subform, the lostfocus event does fire when going to another control in the subform. The problem is that it doesn't fire when going to another control not in the subform. Is there anyway I can get the lost focus event to fire under these circumstances?
Thanks,
scratch
View 1 Replies
View Related
Nov 10, 2005
Ok, I'm new here and I've searched through the forums and found similar questions asked but no one ever seems to have an answer. I've also looked on other forums and still no solution. So here goes...
I have a tab control with several tabs. On half of these tabs are subforms and the other tabs just have text boxes. When you click the any of the tabs, the entire tab control shifts to the bottom of the screen. The user would have to manually scroll up to continue inputting data.
I added a .gotopage method to the tab control and that fixed the problem in that when you click on a tabbed page, the page is positioned correctly on the screen. However, if I click on a tabbed page which contains a subform, I now get a VB error which says invalid page number argument.
If anyone has experienced this or knows a fix, I'd really appreciate it. Thanks! :confused:
View 6 Replies
View Related
Sep 29, 2006
I am in the process of upgrading a database, mostly by borrowing things I like from a similar database. I've borrowed a subform, along with it's underlying query and have modified my tables accordingly. All fields should match up.
Said subform is embedded on a page of a tab control. I've been modifying it regularly in design view, but when I switch over to form view, none of my controls show up. It just shows a blank yellow background.
This makes me very sad/frustrated. Please help!
View 3 Replies
View Related
Nov 15, 2004
I know how to refer to a control on a form by using [forms]![formname]![controlname], but can anyone help with referring to a subform.
I have a subform called subPrograms, on which is a combo box whose contents need to be filtered depending on the selection from another combo box on the main form.
The combo box on the main form is cboDivisions.
The combo box on the subform is cboPurchasers
Main form is called frmMain
Subform is called subPrograms
The user is supposed to select a Division, and then depending on that selection the contents of cboPurchasers will change to only show those that are within that same division.
I would also like to know how to update the cboPurchasers when the cboDivision has been selected? Can someon help?
I hope that this is enough info.
View 2 Replies
View Related
Sep 2, 2004
I'm trying to check if a control on the subform is null. I've the following line of code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Form!FrmOrderInfoMain!SubFrmOrderInfo.ItemC ode) Then
Msgbox "Empty ItemCode"
End If
End Sub
..whereby FrmOrderInfoMain is the parent form and SubFrmOrderInfo is the subform. I get an error for this code as Im not sure what is the correct code to use. Thanks for the help.
Swee
View 7 Replies
View Related
Dec 16, 2004
I have a control called TotalPaid in a subform Footer section that sums up payment Amounts in the Details section. TotalPaid's control source is simply =SUM([Amount]).
That's it. Nothing tricky, I'm not summing up calculated controls or anything...
PROBLEM: TotalPaid frequently displays "#Error".
I can determine absolutely no reason for this. It is inconsistent, and is not specific to any certain subform records or mainform records. If I go to the next mainform record and then go back, the #Error will often disappear, to be replaced by the apprpriate SUM value.
Is this an Access 2000 bug?? I need to know what causes this and what I can do about, since the value in TotalPaid is VERY important to many of my other calculations. When it gives an #Error, my whole app becomes worthless.
View 4 Replies
View Related
Nov 26, 2013
I currently have a form with a combobox that I want to use to control a subform that I have inserted. Both the parent form and the subform are pulling data from a different table. From the combobox, I want the user to be able to choose a persons name, and then the subform will display each project that the person has worked on based on the name that has been chosen. The reason that I have a subform is so that the user is able to click through projects that pertain to a certain employee. I have the master fields and child fields linked on the employees name as there are not to many employees and the names are all unique.
View 3 Replies
View Related
Nov 4, 2014
I have a form that incorporates 2 subforms. I have all but 1 thing working as intended. I have setup a button to submit the entries (and handle a few other control functions) but I need to validate a single control within the first of the 2 subforms. This should be simple but it seems I am missing something. I just need to check for null or blank and if true open a message box to explain that it is a required field and to then exit the sub without any further execution. My problem is that no matter how I type the code I cannot get it to recognize the control (which is a combo box). Even identifying the from the control is on does not seem to work.
View 1 Replies
View Related
May 15, 2015
I am trying to set a value to a control in my subform (On Load) but it is not working.
FRM_ASQ has a button upon clicking open a FRM_Planchange_Input which has a subform FRM_PlanChange_Input_Details.
On Load - I assign values to controls in the FRM_Planchange_Input and I am trying to assign values to control in the subform FRM_PlanChange_Input_Details.
On Load,
SetPropery -
Control Name: [Forms]![FRM_Planchange_Input]![FRM_PlanChange_Input_Details].[Form]![ASQ]
Property: Value
Value: =[Forms]![FRM_ASQ]![ASQ #]
I am copying the data in Form ASQ to Subform Plan Change Details. Whenever the macro is run, it gets stuck at the point giving an error "The control name is misspelled or refers to a control that doesn't exist. If the invalid control name is in macro, an Action Failed dialog box will display the macro name and the macro's arguments after you click OK."
Upon clicking OK, i get Error Number 3021 - Arguments [Forms]![FRM_Planchange_Input]![FRM_PlanChange_Input_Details].[Form]![ASQ]
The syntax I used is based on this article: Forms![main form name]![subform control name].Form![control name]. I also read that Subform Control Name and Subform Name are not the same?
View 3 Replies
View Related
Aug 4, 2005
Hi,
I'm trying to reference a control in a subform from a module but I keep getting errors!
Here's what I've tried.. and what error I've been getting:
First try:
GetCboEntries = Forms.frmMain!frmSub.Form![cboEntries].Column(1)
(where frmSub is the name of the actual form in the subform control)
Error: Object doesn't support this property or method
Second try:
GetCboActivities = Forms.frmMain!chdMain.Form![cboEntries].Column(1)
(where chdMain is the name of the subform control)
Error: Object doesn't support this property or method
Third try:
GetCboEntries=Forms!NameOfMainForm!NameOfSubform![cboEntries].Column(1)
Error: Run-time error '2450':
Microsoft Access can't find the form 'frmMain' referred to in a macro expression or Visual Basic code.
Any help would be much appreciated!
Thanks in advance!
View 1 Replies
View Related
Feb 21, 2005
Lets say I have Form A and Subform A with the parent-child relationship established that works well. Subform A has a Text box control that is getting display when I include the subform in Form A.
Now, I decided I dont want to include subform A in the Form A. Is there a way for me to show the contents of that Text box control in Form A without attaching the subform in the main form (Form A)?
I read somewhere that to refer a control on a subform, I have to use the code - Forms!mainform!subform.form!control. But this would be in VBA. What is the equivalent of this in a Control Source in the main form?
If I have not explained myself correctly, please do let me know.
To summarize, my question is without including the subform, I want to reference the values of the subform in the mainform. (I have some design necessity for this requirement) Is there a way for this?
thanks!
View 1 Replies
View Related
Aug 16, 2005
Hi
I have read through this forum and found some help on this but can't get it working.
I have a subform
Activity
Contains a tab control with two tabs
Activity Details - Persons
I want to copy the address field from Activity Details tab to the Address field on persons tab
Code for the on click even twon't work. Can't find errrors. I know it is because I haven't referenced it properly.
Me.txtpersonBuildingNameNo = Me.txtactivityBuildingNameNo
Any help :)
View 3 Replies
View Related
Feb 24, 2006
I have attached a condensed copy of my form/sub-form that has calendar controls on it for the RecvdDt and the Compliance date. I have it set up the say way as I have on other databases and it will not close/populate once opened. I have reset the events on it multiple times and I just can't get it to go.
Can anyone please take a quick look and help me determine why it is not working on this form yet works on others that I have.
Thanks.
View 5 Replies
View Related
Mar 15, 2006
Hello everyone...
I have a form that I want to copy selected field values to another form & subform.
I have no problem copying some field values to frmEndorsement... but I can't figure out how
to copy the other field values to the frmEndorsementSubform. I tried several ways but I'm still
on a dead end...
Here's the actual example...
I want to transfer some selected fields from "frmEncounter" to "frmEndorsement" & "frmEndorsementSubform"
In my frmEncounter, I have these fields...
mdsunit, patientID, lastname, firstname, pcp, & encountID ( EncountID is autonumber-PK)
In my frmEndorsement, I have...
patientID, lastname, firstname
& in my frmEndorsementSubform, I have...
pcp, msdunit, & encountID ( encountID is numeric-long integer )
There is a link master-child field between frmEndorsement & frmEndorsementSubform which is patientID.
and below is my code that I got from Ms. Candace Tripp...
Thanks in advance... Jim
Private Sub cmdcopy_Click()
On Error Resume Next
Dim bOpen As Boolean
Dim ctl As Control
Dim frm2 As Form
Dim ctl2 As Control
' check to see Endorsement Data Entry is open
bOpen = IsOpen("frmEndorsement")
If Not bOpen Then
' open form
DoCmd.OpenForm "frmEndorsement"
End If
Set frm2 = Forms!frmEndorsement
' send data to frmEndorsement
' look at each control on frmlEncounter
For Each ctl In Me.Controls
' only look at combo boxes and text boxes
If TypeOf ctl Is TextBox Or TypeOf ctl Is ComboBox Then
' now look at each control on frmEndorsement
For Each ctl2 In frm2
If TypeOf ctl2 Is TextBox Or TypeOf ctl2 Is ComboBox Then
' if the control names are the same,
' set the value to that control on frmEndorsement
If ctl.name = ctl2.name Then
ctl2.Value = ctl.Value
End If
End If
Next ctl2
End If
Next ctl
Me.PCP = Forms!frmEndorsement!frmEndorsementSubform!PCP
Me.EncountID = Forms!frmEndorsement!frmEndorsementSubform!Encount ID
Me.mdsunit = Forms!frmEndorsement!frmEndorsementSubform!mdsunit
End Sub
View 1 Replies
View Related
Jan 12, 2005
I have a control on my main form which attempts to total the amount from all subrecords on that record. For example, I have fields called ValueA and ValueB in the subform. If I have 5 subrecords in a record, then I want the control to sum all 10 fields (5 for ValueA +5 for ValueB). How can I do this?
View 14 Replies
View Related
Nov 14, 2006
Still beating my head on the wall. I'm sure it is simple but I NEED guidance.
I've made a macro to show a date field when the "Yes" option button is selected and hide it when the "No" option button is selected. I first created it for the form to act on its own --> and it works. Now I want to use that form as a subform in the form [frmTestPkg]. I am having problems figuring out how to reference it properly as a subform.
Here's my macro that works when I attach it directly to my form:
Condition:[Forms]![frmsubcruiseplan]![CrPlRecvdNo].[OnGotFocus]
Action: SetValue
Item: [Forms]![frmsubcruiseplan]![CrPlSubmDate].[Visible]
Expression:No
Location: "On Got Focus" Event for the option button "No"
Condition:[Forms]![frmsubcruiseplan]![CrPlRecvdNo].[OnGotFocus]
Action: SetValue
Item: [Forms]![frmsubcruiseplan]![CrPlSubmDate].[Visible]
Expression:Yes
Location: "On Got Focus" Event for the option button "yes"
I have followed the pattern provided previously of
Forms![main form name]![subform control name].Form![control name]
but cannot get it to work -- obviously messing up somehow.
The reference I tried in the condition looks like this
[Forms]![frmTestPkg]![frmsubcruiseplan].[Form]![crplanrecvdNo].[OnGotFocus]
--> and with or without the setvalue information included I get a "The object you referred to as an OLE object isn't an OLE object" error.
Perhaps I am not identifying the subform control name properly? Or maybe I should be referring to the "Cruise Plan Recvd Option" instead of the individual control boxes (but it worked as a form)? Please spell it out for an idiot, what this is supposed to look like. Many thanks!
View 1 Replies
View Related
Mar 3, 2015
I have main form (frmProcedures) that has a tab control with 2 pages. One of the pages I have a subform that contains a listbox control controlled by a query.The subform is a search and display form. When I open the subform on it own, it opens up fine. However when I try to open up the mainform, it always prompts me to enter the parameter value. I have to atleast hit "Enter" for the form to open up.Even after hitting the enter key, when I try to navigate to that page, I keep getting the parameter prompt.
Here is the query that populates the listbox control. And the parameter that is prompted is Forms!frmSearchMulti!SrchText that you see in the query below
SELECT Procedures.ProcedureName, Procedures.BusinessLine, Procedures.Manager, Procedures.ApprovalDate, Procedures.NextApprovalDateFROM ProceduresWHERE (((Procedures.ProcedureName) Like "*" & forms!frmSearchMulti! SrchText & "*")) Or (((Procedures.BusinessLine) Like "*" & forms!frmSearchMulti!SrchText & "*")) Or (((Procedures.Manager) Like "*" & forms!frmSearchMulti!SrchText & "*"));
I do have a searchbox that when updated with search string issues the requery to update the values in the listbox.
View 3 Replies
View Related
Jun 19, 2014
I have a main form (frm_main) in which I have a subform as a datasheet (frm_sub1).In the first sub form I have a second (nested) subform (frm_sub_sub2) as a datasheet as well.
On the main form I have an unbound text box which gives me the value of the ID field in the nested subform (frm_sub_sub2).In the main this works well, however, I hit a problem at a particular point.
If I expand an entry in the first subform (frm_sub1), then, in the main form (frm_main) I get the first ID value from the corresponding records in the nested subform (frm_sub_sub2) as expected, which then changes as I scroll through the expended records.
However, if I then expand another entry in the first subform (frm_sub1) without collapsing the previous entry, the ID value shown on the main form (frm_main) from the nested subform (frm_sub_sub2) remains the same and doesn't change to the currently selected record. Even if I then collapse the first selected entry on frm_sub_sub2 - the original ID value still remains on the main form (frm_main).
View 1 Replies
View Related