Selected subform record becomes unselected after code runs

After figuring out that you can't use a Split Form in Access 2007 as a 
subform, I went back to the old way of adding a datasheet view subform to my 
subform.  (main, subfrm, subsubfrm). If the user clicks on a record selector 
on the subsubfrm datasheet, the subfrm goes to that record.  However for 
some reason the record highlighted in the subsubfrm datasheet is no longer 
highlighted - it goes back to the first record.  But if I put in a break 
point and step through the code, when it is done the selected record is 
still highlighted.  The code is simple, nothing else happens on either form, 
on current or anything...

        Dim tempID As Integer
        tempID = Me!ID
        ' Find the record that matches the control.
        Dim rs As Object
        Set rs = Me.Recordset.Clone
        rs.FindFirst "[ID] = " & Str(Nz(tempID, 0))
        If Not rs.EOF Then Me.Bookmark = rs.Bookmark

Why would my subsubfrm go back to the first record if I don't step through 
the code, but remain on the selected record if I do step though?

Mich


0
M
5/21/2010 8:38:40 PM
access.forms 6864 articles. 2 followers. Follow

0 Replies
740 Views

Similar Articles

[PageSpeed] 19

Reply:

Similar Artilces:

How do I make numbers become text?
I am trying to create a spreadsheet where numbers entered in one location become text in another. I tried the Help option, but I am still lost. Please help, and thank you. From earlier postings: How to Convert a Numeric Value into English Words http://support.microsoft.com/default.aspx?scid=KB;EN- US;140704& and: (courtesy of a cut and paste from a Tom Ogilvy post): If you want an addin that provides a worksheet function that does this, download Laurent Longre's free morefunc.xll addin found here: http://longre.free.fr/english/ It is downloaded in a zip file which also conta...

User able to see records that he is not supposed to
Hi, I have a user having a role that has permission to read only records that are created by him. He is able to see records that are assigned to a team X. He is not a member of team X. I have no clue how he is able to see it. I have checked every setting very carefully.Please help. IS IT a Microsoft CRM BUG??? Cheers, kunal Hi, Kunal, Can you please provide the specific settings of the security role(s) assigned to the user? Thanks, Leslie -- This posting is provided "AS IS" with no warranties, and confers no rights. Please do not send e-mail directly to this alias. This ...

First row in Selection range (first index of a cell)
Hello, I have a problem with selecting first cel in selection Range or return an index of the first cell in Selection Cell. I have something like this: .................... Range1.Select "and here I want to Select the first range in selection Range1" ............. I there any special function of finding first cell in selection range or returning an index of the first cell?? Thanks for answet Marcin Maybe range1(1).select or range1.cells(1).select or range1.cells(1,1).select mar_male@wp.pl wrote: > > Hello, > I have a problem with selecting first cel in selection...

Excel 2000 running on Windows XP SP2 does not properly open CSV fi
The same file opened in using Excel 2000 running in Windows 2000 Pro open properly. The rows and columns are formatted properly. The same Excel 2000 opening the same CSV file but on Windows XP SP2 will not properly format the rows and columns. Hi check your regionals ettings in Windows ('Start - Control Panel') I'd suspect you have different column delimiters specified (comas versus semicolons for example) -- Regards Frank Kabel Frankfurt, Germany "Oscar" <Oscar@discussions.microsoft.com> schrieb im Newsbeitrag news:4985F8F5-5D33-425E-989C-65529CE63D05@mic...

Tabbing into continuous subform ignores the first control
When I tab into the subform, from the last position in the main form, the focus moves to the second control in the continuous subform except on the first record entered in a session. I shift+tab back to the first control and the tabbing is normal from then on until the next record gets to the subform. The order of the controls on the subform is the same as the fields in the underlying table and the effect is the same in Datasheet view (of the subform). This first control on the subform is a combo box if that effects anything. Is there a way to get the tabbing right? ern. No, I thought the...

Prinding each row of Excel sheet on a seperate page dispallying one record on each pa
From a spread sheet ,I need to print out a row on each page seperately that is printout each record on the row on one page seperately. Can any one please advise how it can be done ? Fro example Row 1 Data 11 Data 12 Data 13 Row 2 Data 21 Data 22 Data 23 Row 3 Data 31 Data 32 Data 33 I would want to print out Data 11 and Data 22 on one page then Data 21 and Data 22 on the second page and data 31 and Data 33 on the third page Pleae advise if and hwo this is possible. Thank you Sanjeev --- Message posted from http://www.ExcelForum.com/ Sorry ...

Selecting Text Box
Is there a keyboard command that one can use with the mouse to select the text box (frame) rather than trigger the Edit Text mode? When there are many objects on the page, getting the mouse to click on the right frame can be a real problem. But if the cursor is in the right box, some keyboard command (with or without the mouse) should help select the right object. Thanks! ...

Record Change Confirmation
This is a multi-part message in MIME format. ------=_NextPart_000_0081_01CAB184.C1BB7DD0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Access 2007 sp2 I'm using the following code I found on the web, on a Single Form, to = have the user choose to either save the record or not save the record or close the message box and continue editing: Private Sub cmdSaveAndClose_Click() If Me.Dirty Then Dim BlnOutcome As Integer BlnOutcome =3D MsgBox("Record(s) have been added or changed." _ ...

Formula to reference another worksheet, locate data, then record i
Hi All, It has been over 10 years since I did my Excel studies and I've unfortunately forgotten everything I haven't used regularly. My office has recently upgraded to Office 2007 (upgrade not being the descriptor I'd have chosen!) and I'm struggling with Excel. I've found my way around most issues, but I'm REALLY stuck now and suffering Friday-itis on top of it all! Essentially I have a multi-sheet workbook for my debtors ledger. Each page has separate columns for the customer numbers, names, total debts in each age range (7 days, 14 days etc), totals and lastl...

SQL select statement question
My dataset has 3 columns: customer id, store location, charges I'd like to write a single select statment that will show each customer id once, with the store location where they have the most charges, and the sum of the charges for that store location. This gives the max charges for each customer, but doesn't give the location: select a.custID, max(new.amt) from smallchg a inner join; (select custID, location, sum(charges) as amt from smallchg group by custID, location) as new ; on a.custID= new.CustID group by a.CustID thanks. joel Try this -- SELECT TOP 1 ...

Template driver code for a new USB Touchscreen XP driver
We want to develop a new Touchscreen driver having a USB interface for Windows XP. Which driver template will be the most suitable to start the development ? make your device a HID and then you not have to write a driver at all. d -- This posting is provided "AS IS" with no warranties, and confers no rights. "sanju_emb" <sanju_emb@discussions.microsoft.com> wrote in message news:E8AAAA05-B6EA-44A7-B9E8-20E5F0A5860C@microsoft.com... > We want to develop a new Touchscreen driver having a USB interface for > Windows XP. Which driver te...

Button on Form to Run Report based on Query with Parameters
Hi Guys. I am busy working on a stock control database (and job control). When I have a Form Open, it shows several fields, including JobID (Which is the PK for that job) (frm_Invoicing) I also have a Query that when Run, it prompts for the JobIDNo. (qry_CustJobsInvStock) I have a report based on that query. (rpt_CustJobsInvStock) I have added a button onto the form (onclick -> DoCmd.OpenReport) to open and automatically print the report, But I just cannot figure out how to get it to get my JobID from the form, and to Automatically add it as a Parameter for the que...

Error code 57E
I have Vista 32 bit XP windows Home Premium. Try to install 2007 Microsoft System KB972581 and Visio Viewer 2007 Service Pact 2, stalls at 50% install, however any other updates are installed. I have turned off the firewall and Microsoft Security Essentials and tried to install after, and still error code 57E on these 2 updates. The updates that did install are as follows... Cumulative Security Active X Killbits Microsoft Outlook 2007 Junk Mail Filter Security Essentials for Microsoft Office Windows Malicious Removal Tool Security Update I had this problem before with the SP2 ...

checking for existance of file before running macro
I have a macro that opens a source file to retrieve information. I want to be able to check to see if it's there first and if it's not send a msg to the user stating that the file isn't there. When the user clicks okay on the box I want the macro to end without error. Can anyone help? thx, Jim You can use the Dir() function: dim myFilename as string myfilename = "C:\autoexec.bat" if dir(myfilename) = "" then 'it's not there else 'yes, it is end if Jim wrote: > > I have a macro that opens a source file to retrieve information. I wan...

Comparing records in 2 databases
I need to update an access database each day, with stock and price info, and then update it online. Is there a way to compare the before and after tables, and make a new table with only the changed records (only the changed fields!) plus the primary key? OR, does anyone know of a fairly inexpensive program that will do this? For Access 2k. Thanks! Tracking date record was created or updated, SQL Syntax --- It is a good idea to add these 2 fields to all your tables (except lookups). Let them be the last 2 fields. DateCreated, date, DefaultValue = Now() DateModified, date � set on...

Advanced Find should let me search records between two dates
When searching the system for records, many times I need to search for records that came in between two dates. For instance, I would like to be able to pull all records input in CRM between March 1 and March 15. In 3.0 you can only query specific dates like "Last X days," "Last X Months," "On," "On or After," etc., but you cannot search the date fields between two dates. The functionality was available in 1.2 but is not available in 3.0. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the...

Qry Running Average
I am really stuck. I have tried this a dozen different ways without results. I want to take a simple query (Query has date formatted to month and a summed quantity) and create a running average by 12 month groupings as well as extend out to 6 months beyond for running average forecast; as shown below: [The 12 Month Running Avg are my own calculations, this is where I am stuck] Part Nbr Month SumOfOrd Qty 12 Month Running Avg 51009 Mar-06 8 51009 Apr-06 1 51008 May-06 1 51008 Jun-07 0 51008 Jul-07 0 51008 Aug-06 3 51008 Sep-06 0 51008 Oct-06 12 51008 Nov-06 2 51008 Dec-06 7 51008 Jan...

SMTP service does not fail over to the next mail MX record
I have a problem whit SMTP outgoing mail on my Exchange server 2003 sp2 on a Windows 2003 sp1 and all fixes and updates on. The SMTP service does not fail over to the next mail MX record after the host for the first (lowest) MX record returns error. I have tested with SMTP Diag from the exchange server to several domains where the first MX record return error and SMTP diag failes over like it should do. I’ve tried to use both internal and external DNS whit the same result. I know that this error was fixed in W2K3 SP1. Any ideas ? What are you determining to be an error here? Is the...

Run-time error 438?
Hello, I am trying to create an edit control for my form. I lock my textboxes in properties and then I created a command button with an event on onclick. My codes are working for most of them expect a few. When I click the button it gives me Run-time error 438. My code is based liked this. Me![Control].Locked=False Private Sub Edit_Record_Click() Me![Drago ID].Locked = False Me![Drago Claim Number].Locked = False Me![Dealer Claim Number].Locked = False Me![Dealer].Locked = False Me![Store].Locked = False Me![Machine Acres].Locked = False Me![Part Fail Date].Locked = False - NOT WORKING ...

Display Screen 1/2 Grid; 1/2 VBE (or at least Code Window)
Is there a way (button, command, etc) to be able to view (quickly, and side by side) a my worksheet (only 1 workbook is open say) and my code window? If you just want to look at macros do a cltr+' (key to left of 1). John North Yorkshire UK "Jim May" <jmay@cox.net> wrote in message news:Fqb7d.10064$0j.2648@lakeread07... > Is there a way (button, command, etc) to be able to view (quickly, and > side > by side) > a my worksheet (only 1 workbook is open say) and my code window? > > Jim With Excel workbook open to the sheet of your choice and VBE o...

Autoexec macro code
Hope someone can help. Looking for suitable autoexec macro code to open my database automatically. My database does not have a switchboard. Not sure if I need one to do this. Thanks, regards, Paul. Hi Paul, If your database doesn't have a switchboard, what is it that you want to open automatically when your database opens? Try setting the startup properties if you want to open a specific form - right click on the database window and left click on "Startup". Hope this helps. Damian. "Paul" wrote: > Hope someone can help. > > Looking for suitable au...

Matching Zip coded in a Query
I have query that joins two tables using the Zip Codes (only show the records where the Zip codes match). The problem is that in one table, the listing of zip codes, it is 5 digit zip codes. In the main table some of the zip codes are 5+4 zip codes. My current query leave out the 5+4 Zip codes. I want all the records as long as the 5 digit zip codes matches. I quess I could delete the - and the last 4 digits on the main table, but it would be nice to retain the whole zip codes. Is there a way to do this? Thanks!!!!! Use Left(MainTableZipCodeField,5) to compare to the original ...

Updated records in forms
Each record in a form is a work order. School, contractor, days of work, etc. I have a pop up calendar to select a week ending date for each record. Record 1's week ending date is Nov 13, 2009. Record 2's week ending date is Nov 20, 2009. When I change the date in record 2, it's changing the date in record 1. Each record's week ending date become all records' week ending date? Can I use a pop up calendar in a record and be able to retain the correct week ending date for each record. If so, how would I be able to accomplish this? Thanks for your inp...

Wpf tooltip exist Direct3d memleak in native code in xp and vista os
<1>use the D3D control panel, enable the debug DLL and maximum validation,for D3D control panel ,you need to install the directx sdk. <2>Start up the debug monitor (<MSVC install directory>\Common7\Tools \Bin\winnt\Dbmon.Exe). <3>If you use the tooltip in native code,then run the program,show the tooltip,then exit the program, the Dbmon.exe will report serious direct3d9 memleak in xp and vista os.but If I use the wpf tooltip in c#,it is no problem. I do not know why? The following is my code fragment of mfc project void CFntClrDialogDlg::OnClick() { if((ToolTip...

requery subform from sub form
Thank you how can i requery subform from subform ? "a" <youb@hotmail.com> wrote in message news:%23R9c$8tSIHA.2000@TK2MSFTNGP05.phx.gbl... > Thank you > how can i requery subform from subform ? Me.Parent!Subform2ControlName.Form.ReQuery thank you the work correctly "Stuart McCall" <smccall@myunrealbox.com> wrote in message news:fl83eg$3o6$1$8300dec7@news.demon.co.uk... > "a" <youb@hotmail.com> wrote in message > news:%23R9c$8tSIHA.2000@TK2MSFTNGP05.phx.gbl... >> Thank you >> how can i requery subform from subfo...