i have a button that allows you to "edit" the show that is selected. You can double click the show name from the list box, and it opens that show in viewing mode, but you cant edit it. You can click the edit show button in the form that you view the show with, but I want to be able to edit that show from the main form with the list box. But, the problem im having, is if someone clicks the "Edit show" button without have a show selected, they get a error.
If lstShows has focus Then
DoCmd.OpenForm "frmEventsEdit", , , "EventID = " & Me.lstShows
Else
'do nothing, since having no code here, it does nothing
End If
End Sub
That is what I want, but I cant get access to open that show up if its selected.I need to be able to tell if it has focus on it, and to open that selected show up.
I have a form with 3 list boxes. The user selects an option from each list box and depending on their selection a set of data appears in a subform. If the user then goes back to the first list box and makes a new selection, the next two list boxes still have their records highlighted from the last set of selections. What is the line of code that would remove the focus from the second and third list boxes if a value in the first list box was changed?
it is possible to be able to scroll through a List Box with just a mouse over? Or, do you need to set focus on the ListBox before being able to scroll?
On a main form I have 2 sub forms. On the main form I have a command button that asks how many guests in a booking and depending on the response populates the subform with Guest Names. However it will only do this if I click on the subform and then click the command button.
I want to include some code that sits behind the command button on the main form that will duplicate the otherwise manual selecting of the sub form. And I am thinking this is a SetFocus procedure.
I have tried this code; [Forms]![Booking].[SubForm1].SetFocus where Booking is the name of the form. I do not know whether the Subform is #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 customer provide his or her SSN. If the SSN matches a record in a table the form opens specifically on that record (no problem). If the SSN doesn't match a record, the form adds a new record (again, no problem).
The issue I'm having is with the new record. The customer is able to scroll through other records (page up, page down), which is a no-no. I need the form to be locked on the new record. I've posted my code below.
Private Sub Command543_Click() On Error GoTo Err_Command543_Click Dim strCriteria As String Dim rst As DAO.Recordset Set rst = Me.RecordsetClone
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 continuous form with a combobox and a text box. In the after_update event of the combobox I want to setfocus on the text box - of the specific record that I'm on. I tried using Me.CurrentRecord but that returns me to a completely different record than the one I was on. How can I setfocus to the text box of the record I am on?
I have a subform that I use to scan in products using a barcode reader, when the item scans it moves to the quantity (Qty) field where I have this code:
Code: Private Sub Qty_GotFocus() Qty.Value = 1 DoCmd.GoToRecord , , acNewRec txtOrderNo.SetFocus End Sub
I am simply trying to set the Qty value to 1 and move onto the next record ready to scan another product in.
I have a Dynamic Search form, which I use to search for client, on the double click it takes me to the client, at which point I have the Forms Visible set to False.
When I click on a button to open that Form, the Visible turns back to True, however it shows my last search results, how do I clear it so that when I call it back up it is ready to search again, and my focus is set to the SearchFor box.
In a form, I go to a textbox with setfocus. The whole text is selected then. But how can I place the cursor after the existing text, so that I can begin writing immediately?
When the client clicks in a text-Box or Combo-box in a sub-form, the field seems to jump to the side. in this image it jumps to the left, but jumps to the right to..., it is quite irritating, especially attempting to open a combo-box list, and see the button jumping aside.We renewed the file many times, so I don't think it is corrupted, but go know..the file can be accessed via network or terminal server, the pic is from terminal, but happens via network too.
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 am having trouble setting the focus on my forms... I have a parent form with two labels that are coded like this.
Private Sub Advisory Messages_Click() Me![ Advisory Messages].Visible = _ Not Me![Advisory Messages].Visible End Sub
[code]...
I have the visible property set to no on the subform allowing the user to toggle the visibility when the label is clicked. The problem though is when I click inside the subform to use the scroll bar to view records, it transfers the focus to the subform making it almost impossible to close by clicking the label again because the label is on the parent form. I found the "me.parent.setfocus" command and a few other set focus commands but I don't know what I should be applying the command to in order to make it work.
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 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.
I have a form with a tab control on it. The input for respective fields are placed inside the tab control, and I have the "Confirm" button placed outside, on the main form. Now I wanted to be able to navigate my focus from a control from inside to tab control, out to the Confirm button on the form, to allow smooth flowing data entry.
However, it seems like Access separates the tab indexes for the controls in the tab control and outside on the main form, so setting tab index does not work. I tried using the code ON LOST FOCUS and SET FOCUS;
Private Sub txtPurchaseNote_LostFocus() Forms![frm Imported]![cmdConfirmPurchase].SetFocus End Sub
But then a dialog box appears:
Run-time error '2110' Microsoft access can't move focus to the control cmdConfirmPurchase
I have a form (Home_Interview_Form) with several subforms (AirFresheners, Pesticides1 etc), and I would like the cursor to move from the last field in one subform to the first field in the next subform on keydown. I have written the following code, but instead of sending the cursor to the first field (PestSpray) it is going to the next field (PestSprayCom) in the subform for some reason. I am using Access 2013.
Private Sub Fresh2React_KeyDown(KeyCode As Integer, Shift As Integer) Forms!Home_Interview_Form!Pesticides1.SetFocus Forms!Home_Interview_Form!Pesticides1.Form!PestSpr ay.SetFocus End Sub
If I open the form directly from the left pane (all access objects) forms engineering entry the form opens and combo51 has focus (the cursor is in it)
If I open it from the Engineering tab on the navigation bar the Engineering Entry is the default left hand form and opens, but no focus as in the screen dump.
If I go to the code on Engineering Entry, On Load, Combo51.SetFocus This doesn't seem to work as I would expect.
How can I get this combo box to get focus when opening this form via the navigation bar.
I have a Main Form with a tab control. On each of the six tabs is a SubForm that takes up the entire tab. So basically I have a tabbed interface for my forms, just with a bit more control over the layout than if I just opened the forms separately in the Access window.
Anyway, on one of those subforms is a button. When you click it, it opens a separate form in a pop-up window, which is used to find a specific record. Once that record is found, you can click another button, and the idea is that this pop-up window closes, and you return to the underlying form, which jumps to the record you selected.
So far so good. Now, if I am working on my program in Access, and I open that subform's source form separately in its own tab, click the icon to open the record finding form, find a record, and then click the button to load that record, the following code runs, and it runs flawlessly - closing the pop-up window, and passing the information back to the main form which displays the proper record:
Quote:
Private Sub ViewRecord_Click() Dim RecordID As Integer RecordID = Me.ID DoCmd.OpenForm "CDLExam", , , "ID = " & RecordID DoCmd.Close acForm, "CDLExamCONT", acSaveNo End Sub
Where my program falls apart is that, in actual use, this form is not open on its own. It's open as a subform on one tab of a tab control on a Main Form. So the third line of code falls apart. Access thinks I want to open CDLExam separately, but it can't because it's already open in the subform, so instead I just end up back at the main window like I want, but the form fails to move to the proper record. Basically, line 3 just doesn't do anything.
How can I make this work? I tried replacing "CDLExam" with the name of the main window, but then it tries to move to the record in the main window, which throws an error as the main window doesn't even have a record source attached to it.
how to refer to the SUBFORM which has CDLExam open, and tell THAT to move to the proper record.