and two sub-forms called "frm_fabricator" & "frm_engineer"
On the sub form "frm_fabricator" I have a combo box and after updating this combo box (called fabricator) I would like the cursor to jump into a field called “ApllicationsEng” on the other sub form "frm_engineer"
I have a form that allows me to update entries in a table. When I select the line I need to update and hit the "edit" button I get a run time error '2164' You cant disable a control while it has the focus. when I debug the line in the code that is highlighted yellow is Me.cmdEdit.Enabled = False.
I developed the database in access 2013, and now I am forced to run the database on a computer that has Access 2003. I have changed the database base to access 2000-2003.
I have a toggle control on a form which depending on selection uses a loop and instr to make 'not visible' a set of controls on a subform.(forms! Mainform !subform.form)I get error 2165 but if I test immediatley before the make not visible process it returns the toggle frame as being the active control.
On my data entry form I have a tab control with three pages
At the bottom of the first page I have a sub form with 3 fields
Currently, when tabbing, the focus runs through the fields as per the tab order
BUT
Once it gets to the subform (datasheet view) it jumps into the first field of the first record rather than the first 'empty cell' thereby starting a new record in the datasheet.
Once the three fields in the datasheet are completed the focus tabs back to the top of the first page of the form rather than onto the next page of the form
How to correctly reference controls using VBA so I could SetFocus where I want?
The Main form is called frm_Admissions
It has three pages called Patient, Treatment & Service Providers
Patient has a subform called sub_Cluster (which may or may not hold Cluster Information)
I would like the tab order to jump from the last textbox on the form into the first field of a new record in the datasheet (rather than the first field of any existing records)
Once it has finished in the datasheet I need to tab to the first field/textbox in the Treatment's page of the form rather than back to the first field/textbox in the Patient's page.
I have a form with a TAB control and four pages. Each control of each page has his TAB index set correctly (starting from 0 to n), some of controls are not enabled to be tabbed. The form's cycle is set on "Current page".
I have two kind of problems.
First: I am on the last control of the page, pressing TAB key the focus gets invisible. Press TAB key again and the focus moves on the first page's control. For each page happens this behaviour.
Second: clicking randomly on the TAB pages the focus is not always on the control with TAB index 0, but usually on the last.
I have read that clicking on a new page the focus should be automatically on the first control, but this does not happen in my experience.
I have an unbound form with a combobox which needs to be validated before the control is updated.In the Before Update event I check that the value is valid and need to reset the value back to the previous value if not valid and then change focus to another control.I thought that the following code would work but the selected value remains in the control and I cannot move the focus to another control.
Code: Private Sub cboYears_BeforeUpdate(Cancel As Integer) Dim dteNewDate As Date dteNewDate = DateSerial(Val(Me.cboYears), Month(Me.txtCalendarHeading), 1)
If i open a form with a sub form on can i open it so that the focus go directly to a control on a sub form.I have tried to do it with a macro on the on open event to go to control but it comes up that the control don't exists on the sub form.i am using access 2010.
I have a single main form with a datasheet subform. When I scroll through the records shon in the main form, each has a different set of child records shown in the subform.
I want the focus to be on the last record of the subform each time.
On the main form, I have a button and this code
Code: Private Sub cmdLast_Click() Me.frmRevisionsSub.Requery Me.frmRevisionsSub.SetFocus Me.frmRevisionsSub.Form.txtRevTag.SetFocus DoCmd.GoToRecord , , acLast End Sub
which works perfectly, when I click the button.
If I call this code from main form's OnCurrent, focus remains on the first line of the subform instead of going to the the last. I have an inkling that it has to do with when the requery of the subform takes place, when I scroll through the records on the main form.
I have a form with a subform which is sized to show several records at the same time. If Record A has the focus, and I click anywhere in Record B, then Record B gets the focus, as expected. ... Except if I click on an Image field in Record B, when the focus stays on Record A.
How I can force it to set the focus to the other record ? I don't think this can be done with Events handlers, as they need to have the focus set first.
I have a form that I created that has a tab control. When the form loads, it automatically sets the focus to a field in the subform. This wouldn't be a problem, except when it does it hides the tabs at the top of the form so I have to go and scroll back up every time I click a tab so that I can see the tabs. Is there a way to adjust this? I have tried hiding a field and setting the focus to it and that didn't work. I also tried setting the focus to the actual tab, but that also did not work.
When I right click a row on the data sheet side of a split form an select "New Record" I want the curser to go to the first field on the single record side. I've placed this in the OnCurrent but it did no good.
Code:
If Me.NewRecord Then Me!Descrfiption.SetFocus. End If
Any way to set the focus to the single form Side of a split form?
I tried hiding a list control by setting its visible property to Flase in VB; however, it keeps returning a message: You can't hide a control that has the focus.
I don't know who to move the focus from my list control before hiding it. I searched in the MSDN online, but with no luck.
I am trying to write simple code that undoes entering a new record and moves the focus to a mandatory field. I wrote the code below; however, I get this run time error message each time I run it.
DB can't move the focus to the control PlotNum.
My code: Private Sub cmbHouseType_BeforeUpdate(Cancel As Integer) Forms![frmHouse]![qryHouse2]![PlotNum].SetFocus If Forms![frmHouse]![qryHouse2]![PlotNum].Text = "" Then Cancel = True Me.Undo MsgBox "Please enter the Plot Number first, then enter the House Type" End If End Sub
I have a form with 2 tabs and a sub form on each of those tabs. form1, subformA, subformB on tab control - tabctrl - pageA, pageB. How can i set focus from one tab to another without actually clicking the tab?
I tried this:
TabCtl.Pages("page2").SetFocus
It's comming up with an error - "object required"
I also tried:
page.2.setfocus and that's comming up with an error that it's wrong syntax.
I also tried:
formMyForm.page2.setfocus and that says object required as well.
I am currently stuck on set focus property. I have a main from with nested subform. I am trying to move the focus from last field of the subform to another field on the main form.
Now I have a field name [Securedesign] in frmOrderdetails and I want the tab order to navigate to field [CustomerID] in frmAddresses which is a subform to frmCustomers.
I have read the threads on this subject and I thought I had my coding fixed, but obviously not, beacause I still get the error, "You can't hide a control that has the focus". Maybe it is a form/subform thing.
Here is my code:
Private Sub txtAge_AfterUpdate() If Me.txtAge > 39 Then Me!subfrmVersion.Form.chkWellness.Visible = False End If End Sub
txtAge is on the main form and chkWellness is on the subform.