Add A Record To A Sub Form Without Focus

Sep 11, 2006

Does anyone know how I can add a record to a subform that is in data sheet view with out giving the subform focus? I have tried the docmd.gotorecord but I keep getting an error that the form is not open. If i set focus to the subform and then use the docmd.gotorecord it works fine but I do not want to set focus to the sub form

View Replies


ADVERTISEMENT

How Do I Set The Focus To The Next Record And.....

Apr 25, 2005

How do I delete this dummy record?

http://img.photobucket.com/albums/v401/Rrotz/phonelog1.gif

Also, how do I set the form to maximize fully like the above, when I open the form it defaults to this:

http://img.photobucket.com/albums/v401/Rrotz/phonelog.gif

View 2 Replies View Related

Forms :: How To Keep Focus On One Record

Jun 22, 2015

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

[Code] .....

View 5 Replies View Related

Requery Moves Focus To First Record

Oct 31, 2006

I have a sub form on a tabbed control. In the subform I have some calculated controls and I make them recalc when ever data in other fields change bu entering a recalc cmd in the update event of the required fields. That is all fine but the problem is that the forms focus moves to the first record and I need it to stay on the active record.

I have tried requery, recalc and refresh methods and they all do the same thing.

All I need to do is up date the calculated controls each time a field is updated and stay on the same form but it's eluding me.

Thanks

View 2 Replies View Related

Forms :: On Got Focus Move To New Record

Jun 23, 2013

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.

View 10 Replies View Related

Forms :: Subform - Set Focus To Other Record

Jan 2, 2014

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.

View 5 Replies View Related

Modules & VBA :: Focus To Be Set To First Control Without Displayed Record Being Changed

Jul 31, 2013

On a form (default view: Single), I have a bunch of bound controls that display one record at a time from tblMain. I have a bunch of unbound controls as well (buttons).

If the user tabs through all the controls, reaches the last one (btnLast), and presses tab again, the focus is set to the first control (btnFirst) and the bound controls change to display the next record. I just want the focus to be set to the first control without the displayed record being changed.So I set up an "If" statement in Private Sub btnFirst_GotFocus()

Code:

If Screen.PreviousControl.Name = "btnLast" Then
[code to change record back to previous record]
End If

But btnFirst gets the focus when the form opens, so Screen.PreviousControl spits out an error.I've accommodated this like so:

Code:

On Error GoTo ErrorHandler
If Screen.PreviousControl.Name = "btnLast" Then
[code to change record back to previous record]
End If
Exit Sub
ErrorHandler:
Exit Sub

View 2 Replies View Related

Forms :: How To Lose Focus From A Subform When Selecting Record

Dec 17, 2014

I have a form, with a subform,

When a user selects a record from the subform i use this to view the record in the main form

Private Sub Txt_Support_Name_Click()
DoCmd.ApplyFilter , "ID =" & Me.ID
End Sub

However when i select the record from the subform, it populates the form as required, however then the top record of the subform is highlighted.

Any way to either - highlight nothing, or highlight the selected row?

View 4 Replies View Related

Forms :: Setting Focus To Control On Single Form Side Of Split Form

Jun 24, 2013

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?

View 4 Replies View Related

Set Focus On Form

Jan 28, 2005

I have a form, and when it opens it has focus on a box i dont want it to focus on

How do i change which box it has focus on when it is opened?

View 3 Replies View Related

Focus On A Form

May 26, 2005

How do i choose the field i want my focus to be on when a form i opened?

View 1 Replies View Related

Forms :: Button In Popup Form - Set Focus To Another Form?

Jan 28, 2015

How can I make a button in a pop-up form to send enter key to a text box in another form? Do I need to set focus to the other form first? And how?

View 1 Replies View Related

Sub Form Steals Focus

Apr 14, 2006

Hi, this is frustrating, and a little complicated, so I'll try and explain it as best I can..

I have a form with two sub forms.

The main form "fmMain" contains a list of species. the subform which is causeing me the problems lists loci specific to each species. The user can search by a species or locus and resrict the list accordingly.

Now, here is the problem. The form is too large for my screen, so I have some scroll bars on fmMain. However, whenever the user performs some kind of search the focus shifts to the subform (I guess), causing the screen to scroll to the middle. From here you can't see the species info, and after each navigation the user has to scroll back up again. It's frustrating having to continually scroll around the screen.

Is there anything that can be done to stop the focus shifting around? I'd rather that when the user performed some action the screen just simply didn't move.

Cheers - sorry for the monster post! (hope it all makes sense)

View 6 Replies View Related

Set Focus On A Form With 4 Subforms

Jun 10, 2005

My main form has four command buttons that when clicked will make visible one of four subforms.

I can switch freely about the subforms by clicking on each of the buttons. However, when I place the cursor in a subform(and thus give it Focus), and then attempt to select another button to open another subform, I get the dreaded "can't hide a control that has the focus" error message.

What type of code should I use and where exactly should I be putting it?

I've tried setting focus to another subform in the OnClick event of my buttons, but that doesn't seem to be working.

View 2 Replies View Related

Form Focus Highlight NOT

Jul 7, 2005

How do I turn off the highlight feature when a control on a form obtains focus?
Fen

View 2 Replies View Related

Forms :: Set Focus To Sub Form?

Sep 14, 2014

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

View 2 Replies View Related

Set Focus When Pop Up Form Closes

Nov 14, 2014

I am trying to set the focus back to page 1 of TabCt186 when pop up form frmEditWorkItem closes on clicking a command button.

I have been trying with this line of code but keep getting asked for an object required.

Forms!frmReactiveTracker!TabCtl86.Pages.Item(1).Se tFocus

View 4 Replies View Related

Setting Focus On A Tabbed Form

Oct 12, 2006

What is the syntax for defining the tab that has focus when a tabbed form is opened under various situations?

View 2 Replies View Related

Forms :: How To Capture SSN From First Form To Use As Focus For Second Form

Jul 22, 2013

I have two forms that have a unique field (SSN).As I'm working in one form, I want to be able to pull up the other form (which isn't a problem). On the second form pulled up, I want the record to match the first form (SSN) - this is the problem.

I believe SetFocus is what I need to use but I don't know how to capture the SSN from the first form to use as the focus for the second form.

View 4 Replies View Related

Passing Focus From A Pop Up Form Back To Mainform

Oct 1, 2005

I have a form for entering data and to aid people inputting data into a text box I would like a pop up form to appear to enable them to refresh their memories as it were with some information. I was going to use the got focus event of the text box to open the popup but how do i then pass the focus back to the main form and text box without triggering the event again

on the flip side I would like to use the lost focus event to close the sub form as well.

any suggestions greatfully received.

Have a Great Weekend, one and all


Dave

View 3 Replies View Related

Forms :: Field Focus In Modal Form

Dec 29, 2014

How do you set the focus on the first field in a modal form when it opens?

View 3 Replies View Related

Forms :: Setting Form Focus Properly?

Jul 10, 2014

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.

View 14 Replies View Related

Keeping Focus On Main Form While Queries Are Running

Jul 23, 2005

I'm sure there is a simple solution - but everything I have tried hasn't worked.
I have a command button on my main form that opens up a popup form. On the popup form the user makes various selections and clicks on another command button(on the popup form). That button is linked to a macro - that runs several queries.

The problem I am having is when the macro starts to run - the main form is maximized again (so now it doesn't take up the full screen - just a part of the screen) and some of the queries start flashing in front of the form.

I know how to maximize the form once the popup form closes - that's not a problem. I just cant figure out how to keep the focus on the main form and in front of all the queries as they are running.

View 2 Replies View Related

OLE Object Won't Get Focus In Form/Memo Field Problems

Jul 26, 2006

Hi all,

I have added an OLE WordPad object to a form. However, when I use the form, I cannot select/give the object focus to activate it. Even if I right click the object, it give me the correct popup menu. :confused:

I am using this object as I am having troubles with Memo fields. I use a form to update records, one field of which must be greater than 255 characters long. When I press my update button (it just runs some code to turn off warnings, run two simple update queries and the turn the warnings back on) the update process seems to complete. However, if I go to the table/refresh the form contents, only the first 512 characters are displayed and the last few are strange system characters.:confused: This occurs no matter what I do. I was tole that copy/paste operations can mess memo fields up, but I tested this by using a fresh field and typing everything in. Hence I am now trying the OLE object to get around this problem. :confused:

Any ideas peeps??

Cheers,

Matt

View 1 Replies View Related

Modules & VBA :: Set Focus Method - Filtering Records On A Form

May 27, 2014

I'm writing some simple code that will filter the records on a form:

Option Compare Database
Private Sub cmdOpenByAnalyst_Click()
cmbStaffNames.SetFocus
DoCmd.OpenForm "BICReviewForm", acNormal, , "Staff Assigned=" & "'" & cmbStaffNames.Text & "'"

End Sub

Unfortunately, I keep getting a run-time error (3075) that says "Syntax error (missing operator) in query expression 'Staff Assigned = XXXX"

View 3 Replies View Related

Forms :: Data Entry Form - Set Focus On Tab Control

Sep 10, 2014

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.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved