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 Replies


ADVERTISEMENT

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 1 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

Set Focus Nothing?

Mar 24, 2005

I have several forms and subforms that display data, but are not used for data entry. The first textbox on every form gets the focus on open. I'm sure I've seen some way to open the form with no focus on any control!

Can someone help me remember?

Thanks,

Sup

View 3 Replies View Related

Get Focus

Apr 15, 2005

thanks for helping.

how do i get a record to get focus when a form opens or a button is clicked on?

thanks again

View 2 Replies View Related

Set Focus

Jan 9, 2006

I am having trouble getting the cursor to change focus after updating a field in my tab control subforms. I have a main form with a tab control and 4 related subforms for each record in the main form.

I have a calendar that pops up with the On Click of my Date field. When the date is selected, it enters it into the field and the calendar closes. For some reason though the user cannot simply go to the next record with the mouse and has to tab to or select another field in the same record first and then click on the Date field in the next record.

I have tried SetFocus to "Hours" (the next field after "Date")and "NextRecord" on every Event I can think of but it does nothing, it just stays on the changed field and the only way to get out of it is to go to another field. I've tried saving, requery, etc. I've also tried the options shown in the forum with no luck and using different events associated with the Calendar form - On Close, Lost Focus, etc.

Any suggestions? Thanks

View 6 Replies View Related

Which Tab Has Focus

Nov 9, 2006

I have a form that has 9 tab pages. I have an amend button in the form footer that will do a different thing depending on which tab has the focus. How can I find out which tab has got the focus when I click the Amend button?

View 2 Replies View Related

Could Not Set Focus

Nov 30, 2006

Hi

I have a problem with setting focus to a text box. There is a listview on the form. Double clicking on a row will search the database for that record using SNo field and then display the contents on the respective control. When I click on a row the first time, it works. Clicking on the second row immediately gives the error "error 2110 - Access cannot set focus to the control txtReference.
Here is the code.......
Private Sub lvwOrders_DblClick()
ClearAll
Set rs = New ADODB.Recordset



rs.Open "SELECT * FROM tblOrderEntry where sno=" & ListView.SelectedItem, con, adOpenKeyset, adLockPessimistic
lblFooter.Caption = "Edit Record"

subRetrieve

End Sub



Private Sub subRetrieve()
Form_OrderEntry.SetFocus
With rs
For i = 0 To lstCostCenter.ListCount - 1
If lstCostCenter.ItemData(i) = !CostCenter Then
lstCostCenter.Selected(i) = True
Exit For
End If
Next i

txtReference.SetFocus
txtReference.Text = !ReferenceNo

txtOrderNumber.SetFocus
txtOrderNumber.Text = !OrderNo

For i = 0 To lstCostCenter.ListCount - 1
If lstCostCenter.ItemData(i) = !CostCenter Then
lstCostCenter.Selected(i) = True
Exit For
End If
Next i

For i = 0 To lstDescription.ListCount - 1
If lstDescription.ItemData(i) = !Description Then
lstDescription.Selected(i) = True
Exit For
End If
Next i

For i = 0 To lstOrderStatus.ListCount - 1
If lstOrderStatus.ItemData(i) = !OrderStatus Then
lstOrderStatus.Selected(i) = True
Exit For
End If
Next i


For i = 0 To lstSalesRep.ListCount - 1
If lstSalesRep.ItemData(i) = !SalesRep Then
lstSalesRep.Selected(i) = True
Exit For
End If
Next i

For i = 0 To lstPaymentMethod.ListCount - 1
If lstPaymentMethod.ItemData(i) = !PaymentMethod Then
lstPaymentMethod.Selected(i) = True
Exit For
End If
Next i

For i = 0 To lstCallType.ListCount - 1
If lstCallType.ItemData(i) = !TypeofCall Then
lstCallType.Selected(i) = True
Exit For
End If
Next i

For i = 0 To lstStatus.ListCount - 1
If lstStatus.ItemData(i) = !Status Then
lstStatus.Selected(i) = True
Exit For
End If
Next i

If !Status = "Pending" Then
txtReasons.Visible = True
lstAssign_Reasons.Visible = False
txtReasons.SetFocus
txtReasons.Text = !Reason
ElseIf !Status = "Assign" Then
lstAssign_Reasons.Visible = True
cmdSave.SetFocus
txtReasons.Visible = False
For i = 0 To lstAssign_Reasons.ListCount - 1
If lstAssign_Reasons.ItemData(i) = !Reason Then
lstAssign_Reasons.Selected(i) = True
Exit For
End If
Next i
End If


End With
End Sub

What can be going wrong ?

View 3 Replies View Related

Setting Focus On Tab

Apr 11, 2008

Hi everyone,

how would i go about setting focus on a tab control? i have a tab control on a form with 6 tab pages. i am on page 4 ( bank ) and i have a button to add a bank account. this opens up the add form and i add the account. i then requery the form and the tab goes back to page 1. how do i set the focus back to the previous opened tab?

many thanks,


Nigel

View 2 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 Problem

Feb 22, 2005

I have two buttons on a form, one of them adds default information to three boxes, the other clears the info. I want to be able to hide one o the buttons depending on what is in the box.

I know I need to change the focus away from the control in order to hide it, but how do I do it please?

I have this so far, but there is something missing!

Private Sub Command744_Click()
Me.BdeRec40kMarksmanship = Null
Me.BdeRec40kFireStatus = Null
Me.BdeRec40kOpening_Range = Null
Me.Command743.Visible = True
Me.command777.Visible = False

End Sub

View 2 Replies View Related

Subforms Focus

Mar 21, 2005

i have a main form, in which i have included 2 subforms on it. Now when i am at the last control on the main form, the focus moves to the first control of one of the subforms. However, when i am at the last control of this subform, on hitting the tab key, the focus does not move to the first control of the other subform.

How can i achieve this please?

Thank you!

View 1 Replies View Related

Focus Problem, I Think...

Apr 6, 2005

I have a form that allows a user to select from a variety of options and then generate a report. It consists of three option groups:

1) Select a Team: A B C

2) Select a Report: A B C

3) Input a Date Range: From (blank) to (blank)

If you progress down the list and finish entering the enddate and then click the mouse on the Run Report button, nothing happens. The cursor remains blinking in the enddate field. You have to manually re-select one of your previous options on the form to get rid of the flashing cursor and then re-click the Run Report button to generate the report.

The option to include the Run Report button in the tab order is not available, I don't know why, but it is an image if that makes a difference.

Any ideas? I'm thinking I have to set focus for something. I just don't know when or where.

Thanks for all replies!

View 1 Replies View Related

Get Focus On A Control

Apr 29, 2005

Hi

I would like a control to have focus when a form is opened or press a button - how do i do this?

Many Thanks

View 1 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

Object Focus

Jul 8, 2005

I'm trying to force a user to enter text into a field. To this end, I've created a subroutine for the exit method of the text box they are supposed to fill out. I check to see if the .text property is null, and if so create a message box that pops up a notification telling the user they need to fill in said field. After that, I try to use the Me.txtReason.SetFocus (the text box is called txtReason) to return the focus to that text box, but instead it moves on to the next text box. Is there a way I can prevent the user from leaving the text box until they've entered some sort of data into it?

Thanks,
Dave

View 4 Replies View Related

Outa Focus~~~~

Sep 14, 2005

Little problem with a form and subform. Problem is...I don't know why I'm having this problem! :)
Have a form with a subform. Everything is working correctly,with one exception. The form is entering payments (checks) then the subform handles the distribution. So after you input one or more lines on the subform you click the "new record" icon. Problem is the focus stays in the subform and not to the top of the main form. I know I could code it to force it to set focus to the first field on the main form... BUT.. I've done this before and coding was not needed. So what did I do wrong on this one?
Thanks

View 6 Replies View Related

List Box Focus

Nov 8, 2005

Hi

I have a list box setup with all the dates from 01/10/05 to 31/12/08.

I want to always start the list box at the current date while still allow the functionality to backdate if required.

I have used the undernoted code to set the row correctly but I cannot figure how to get the box to scroll down to the correctly selected row.

Dim i As Long

i = DLookup("ID", "tblIMDates", "cdate([Date])=date()") - 1

Me.lstDates.Selected(i) = True

Any ideas?

JC

View 5 Replies View Related

Set Focus To The First Field

Mar 7, 2006

I moved the Address field from third postion to first position, so that clicking on a list box places the address from the List Box into the Address field. I adjusted the bound and source boxes and it works perfectly. The cursor now points to the Last Name field (second position, which it did originaly.) I would like the cursor to point to the Address field so as not to confuse the operator. How can this be accomplished? I am sure the correct Event code will do the tick.

View 2 Replies View Related

Got/lost Focus Help Please

May 18, 2006

Hi there.

I have a form and on open it traps the user into a combo box where an option must be selected before they can move to another field. I did this by using the lost focus event of the combo to check if an option has been selected and then return the cursor to the combo if no selection has been made.

The problem is that there is an exit button on the form which the user must be able to use to exit the form without interacting with it, say if they opened the form by mistake and just wanted to exit immediately.

I cant find a way to trap users into selecting an option from the combo before filling the rest of the form while still allowing the exit button to work. At the minute you still have to select an option in the combo even if you just want to exit the form.

I have been a notes developer for years so I’m still not that familiar with access and the way its events work so this could easily be a gormless question. Feel free to point that out. Any comments would be much appreciated.

View 3 Replies View Related

Setting Focus

May 30, 2006

i have a tabular form, which on its after update event, i requery the form, and it works fine. However, my only problem is that after the requery occurs, the focus moves to the first field of the first record. Is there a way in which after the requery, the focus will be set at the end, in that blank record, where to insert a new record ?

Thanks

View 14 Replies View Related







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