SetFocus to a control on a subform - continuous form

Hi 

I can use your help in getting the cursor back to a control on a continuous 
Subform.  The sub has two controls, Inv# and Amount.  I use the AfterUpdate 
on the Amount control to test whether the payment amount equals the invoice 
amount.  If the two are not the same, I prompt the user and would like to 
return the cursor to the Amount control on the last line in this multi-line 
subform. 

Thanks
0
Utf
6/8/2007 4:15:04 PM
access.forms 6864 articles. 2 followers. Follow

1 Replies
1982 Views

Similar Articles

[PageSpeed] 17

Here's the syntax you need in the 2 step process:

Me.SubFormControl.SetFocus                      '-- Set Focus to the
SubFormControl 1st
Me.SubFormControl.Form!ControlName.SetFocus '-- Now set Focus to the control
on SubForm
DoCmd.RunCommand acCmdRecordsGoToLast           '-- And move to the new
record

The SubFormControl is the control that is displaying the SubForm on the
MainForm.  It is the control that has the LinkChild/MasterFields properties
on the data tab.

Rafi wrote:
>Hi 
>
>I can use your help in getting the cursor back to a control on a continuous 
>Subform.  The sub has two controls, Inv# and Amount.  I use the AfterUpdate 
>on the Amount control to test whether the payment amount equals the invoice 
>amount.  If the two are not the same, I prompt the user and would like to 
>return the cursor to the Amount control on the last line in this multi-line 
>subform. 
>
>Thanks

-- 
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200706/1

0
ruralguy
6/8/2007 6:33:27 PM
Reply:

Similar Artilces:

Auto Add Textboxes in Forms
In case of the Forms I use, it is Desirable to make them as compact as possible. Stripped of any unnecessary items. It seems usefull to make a form which ads a new textbox everytime something has been entered in the last one. My question: "What Code should I use to get my forms to add a new textbox everytime something has been entered in the last one?" Thanks in Advance! Don't do it. The maintenance makes it more effort than it is worth. Just set them all up in design, and maybe hide them until needed. -- HTH RP (remove nothere from the email address if mailing direct) ...

SetFocus() ?.....
Hi there. I have a simple dialog-based application. In one dialog's OnInitDialog function, I try to set the focus on a particular Edit box using: CEdit *pEdit = (CEdit*)GetDlgItem (IDC_MY_EDIT); pEdit->SetFocus() however, this seems to have no efect - focus goes instead to another edit (the first in my tab order) Any ideas what I'm missing? Any help would be appreciated!.... "len" <len@discussions.microsoft.com> wrote in message news:3112BEC2-1F8B-4BCD-A056-0A54B05F167C@microsoft.com... > Hi there. > > I have a simple dialog-based application....

Advanced visibility control
I am seeking a possibility to switch different parts of a graphic picture visible depending on some "switch". Ideally I would like to have a few "checkboxes" in one of the corners of my slide and - depending on whether the user checks them on/off - certain elements of the drawing are visible or hidden. Is something like that doable with PPT (v2002/XP)? Note: the point is NOT to make things appear one after the other (that I know I could do using animations), the point is to allow the user to see different combinations of things being visible (or not). Lik...

CONTROL HWND IN DIALOG
Hi, I have created CCustomListControl inherting CListCtrl...I have overridden the InsertItem to assign some dynamically assigned data in lParam, and I am tryin to clean up the same from CCustomListControl destructor... but strange thing is when a dialog is destruction the HWND parameter becomes NULL even before it reaches the CCustomListControl destructor so I could not able to clean up the data.. int CCustomListCtrl::InsertItem(int nItem, LPCTSTR lpszItem, int nImage) { pListItemData = new LISTCTRLPARAM(); pListItemData->m_uiID = nItem; pListItemData->m_uiOrigOrderID = nItem; INT ...

Setfocus question
Hi, I have 5 textboxes on a multipage control. In 4 of the textboxes, the user should enter his details only once, while in the fifth textbox the user should reply a question and click the OK button. No matter what was his answer, he gets new question and the focus shouls be back to the fifth textbox in order to reply the next question. My problem is that I want that the user will be able to send his answers not only by clicking the OK button but also by clicking 'Enter' after typing the answer to the textbox, and I can't get the focus in the fifth textbox after ...

Form Combo Box
We have approximately 4,500 students in tblStudents, and as you would imagine, there are numerous students with the same last name. I have a Find a Record combo box on a form where the user types in the student's last name, hits the Enter key, and Access displays that student's info. This works well unless there are 1 or more users with the same last name. If the user types in the lastname and firstname, it still goes to the first student with that last name. The user can use the drop down box to select another student with the same last name and that works. But it would be nic...

NewsGroup For Common Controls?
Is there a news group for common controls? A place that might have an answer for this: Re: Can't Adjust Size of Balloon-Style ToolTips?? I tried to set the rectangle size for a tooltip control in a handler for TTN_SHOW using the SetWindowPos function (and the TTM_ADJUSTRECT message), as outlined at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/tooltip/messages/ttm_adjustrect.asp This works fine for a normal-style tooltip. My call to SetWindowPos lets me set both the position and the size of the tooltip. But when I set TTS_BALLOON in order...

Update form after note is made
Hi all, I have an order summary form that has a button to add notes. When clicking on the button, a new form appears and allows the user to enter notes. What I was wondering is if there was any way for when the notes form is closed, to have the note then appear in a notes field on the order summary form? I have tried using the refresh, requery methods, but am not having much luck. Any help would be greatly appreciated! Thanks! -gary I have just solved this problem in my application. I have a main form with a subform. There is a button on the subform to add a new record which opens ...

A Static linked control problem
Hello Everyone, I have a problem with static-linked library in my MFC based project. The structure of the projects is like this: MainControl project contains MainControl.cpp and mainControl.h HeadApp.project contains all application files, and the AppDoc class here (created by MFC wizard) contains the MainControl object: CMainCtrl *m_control; It compiles fine intill I try to create the control on Runtime: m_control = new CMainCtrl(); Here I get an unresolved external symbol error, even if I write the exact path to the MainControl header file.. What's wrong? Thanks for your time.. ...

Default value for a field in the create form
Hi all, It's possible to define a default value for a field, in the create form ? Thanks, Hugo You can default a picklist value with out of the box customization but that's it. >-----Original Message----- >Hi all, > >It's possible to define a default value for a field, in the create form ? > >Thanks, >Hugo > > >. > ...

NO INTERNET CONNECTION
this is very frustrating: i am unable to connect to the internet - heres the story: my system runs xp sp2 with an msi motherboard (ms 7093, ati radeon xpress 200, athlon 64 bit, rs480m2 (socket 939)), realtek alc658c audio that uses a realtek ac'97 driver and a creative sb x-fi soundcard, a siemens speedstream 4100 modem, a realtek 8139 family pci fast ethernet nic and a d-link g510 wireless pci adapter. my device mgr indicates that under network adapters, i have working a 1394 net adapter, d-link adapter, and a rtl8139. under "other devices," i only see a yel...

SetFocus problem.
My application has a hidden main display window that is never used. The application hangs out in the system tray and has a couple of configuration windows that can be opened from the system tray menu. The program has a couple of odd-ball fatal error scenarios. When these happen, the program displays a fatal error message using AfxMessageBox and it shuts down normal processing. This includes stopping the system menu so that the config windows can't be opened. Here's the problem: If the AfxMessageBox window is covered by some other program, I want the action of right clicking my...

How to destroy Activex control?
I created a activex control(windowed) in my application(MDI), using CreateControl() Like this: ///////////// CWnd *pWnd = new CWnd; pWnd->CreateControl(.....) ; .. .. .. pWnd->DestroyWindow(); delete pWnd; ///////// Reaching the last statement(delete pWnd;), the AxctiveX control's destructor will not be called. Why? How can i destroy the control? thanks "Frank Wang" <xianfeng.wang@autodesk.com> wrote in message news:%23ruMqGb1DHA.3224@tk2msftngp13.phx.gbl... > I created a activex control(windowed) in my application(MDI), using > CreateControl(...

Stock Control
When products are setup in MSCRM and the quantity on hand field is populated with a number, e.g. stock levels, should this be decreased when orders and/or invoices are assigned to that particular product? Does anyone use stock control callouts/workflow with MSCRM or should it achieve this out the box? No function in this area Out of the box. Need to consider ERP Integration, 3rd Party Addon or SDK. Good luck. Frank Lee, Microsoft CRM MVP Workopia, Inc. http://microsoft-crm.spaces.live.com http://www.workopia.com/Links.htm "PMW_8" wrote: > When products are setup in MSCR...

Form control events get broken.
My colleagues and I have a problem that occurs while designing access forms and it isn't helped by the fact that our applications have a lot of buttons on their forms. The best way I can describe the problem is to explain how to repeat the problematic behavior. 1) Create a blank form and stick a button on it and connect it to some code say: Private Sub Command6_Click() MsgBox ("Hello World") End Sub 2) Change the form to design view. Right Click the button then do edit cut, edit paste from the main menu. Right click the form title bar and choose form view. Click the butt...

Tracking Number on SOP Invoice Form
I am trying to get the Tracking number that is entered in the Sales User Defined Fields Entry Window onto the SOP Long Invoice Form. Does anyone know what tables to create the relationship with? I know the SOP10107 table holds the tracking number into and I was able to get the table in the table list but i must have the incorrect relationship because nothing appears on the report when i add the tracking number. -- Thanks Knavas Hello Knavas, If you are on GP 7.5 SP2 or higher you can refer to KB article 874762. If you are on GP 7.5 SP1 or lower you can refer to KB 859212. Both art...

Listview Control
Hello. I have a table with the following format: Month CostumerName October 2009 Costumer1 November 2009 Costumer1 January 2009 Costumer2 February 2009 Costumer2 I want to display this information in a form. I though on using a listview control with 2 columns. Costumer names has the Header Text and "Month" has the information to fill the Listview. Someting Like the following: Costumer1 Costumer2 October 2009 January 2009 November 2009 February 2009 Is this possible? If not, any sugestions? Thanks Luis. Hi, y...

The Distribution List Form
Is it possible to add some column headers to a Distribution List Form (now contains only the Full Name and the Email Address (or Email 1?). If I can add fields with the Field Chooser, it becomes much easier to use. Can it be done, short of VBA which, like the jitterbug, seems to just plumb evade me? Oops; sorry; Outlook 2003, using Exchange Server, on XP. "Jack" wrote: > Is it possible to add some column headers to a Distribution List Form (now > contains only the Full Name and the Email Address (or Email 1?). > > If I can add fields with the Field ...

SetFocus() and the cursor
Sorry for the novice question here. I have a CEditView in a MDI app. I want to do some things in OnSetFocus() for the view but when I override OnSetFocus() I lose the (carat) in the CEditView. I I suppose I am supposed to turn the carat (cursor?) back on when the focus is set to that view but I am having trouble getting that to work. I can create another carat but it doesn't seem connected to the Edit View since it does not move with keystrokes. How to I resume the default carat or setup a carat that works the same way in my OnSetFocus() routine. Thanks eng What is it that you are d...

load subform
I have a form in datasheet view with a linked subform. I would like the subform to automatically open if a certain condition is met (MAR="NO") in the form. How do I do this? ...

.SetFocus() to an IFrame
Hi everyone, I have a Tab with an IFrame to a WSS doc lib. Since the name of the Account is integrated with SharePoint, I have OnSave code that check to see if the Account Name has been changed. If it has, the user is alerted, and I want the Tab with the doc library to take focus. How can I use .SetFocus() on a tab? I've tried: crmForm.all.tab2Tab.SetFocus(); crmForm.all.iframe_name.SetFocus(); Neither work. So I added a field to the IFrame tab, tried to SetFocus() to that field, then hide it: crmForm.all.my_field.SetFocus(); crmForm.all.my_field.style.display = 'none'; ....

Making a custom combobox control
Hi, all - I'm trying to create a combo box control in VC++/MFC for use in a VB project. The combobox must have the ability to show a dropdown list that is wider than the control itself, and that must be able to align with the left OR the right side of the control. I started by using VS MFC ActiveX control wizard, and had it subclass the COMBOBOX control. Afterwards, I added some essential properties and methods and compiled and tried it out in a VB project. It works after a fashion, but the problem is that when I click the drop button on the combobox, the drop list shows for only an inst...

why not ValidationGroup prop only available on Validators? How a control participated in multiple group?
I see both TextBox and RequiredFieldValidator has ValidationGroup property, what does it mean for a TextBox has a ValidationGroup? Is it always validated by some kine of Validator? So shouldn't only the Validators has ValidationGroup property? Another issues is how to make a control, like a textbox to be validated by multiple validationgroup? For example, there are multiple buttons on a page, there are one textbox need validated by all buttons, other controls just need validated when one of the button is clicked. Or look at other way, how can I button validate a group of ...

importing with a custom contact form results in a notes record
I am importing a comma deliniated dos file to a contacts sub-folder using a custom contacts form and the imported records arrive in a notes format rather than my custom contact format. When I add a record manually the custom form produces the desired result. My form starts with IPM.Contact.Principals. What am I doing wrong? and can I change a notes record to a contact record after the fact. I am using Outlook 2000. Thanks ...

Entourage 2004 Printing Forms problem
Only one form works, the first in the list, "Day Runner Classic (5.5 . . .)" for printing Entourage 2004 Tasks or Notes. Even the "Default 8 1/2 x 11" fails to work. The error dialog number is -30876. I'm working with OS 10.3.4 and an Epson Stylus C84 printer, with which I have no other problems. Is this a known bug? If not, which preference has to be trashed, please? It sounds like you might have a corrupt printing form. Delete this folder: /Users/<Your User>/Documents/Microsoft User Data/Printing Forms/ It will be recreated next time you print somethin...