![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
ALSO ... Am I supposed to be notified via EMAIL when someone answers my post here on Developersdex? I am not receiving notifications. Would you know why? Sorry I cannot help with your main question but you are actually posting to a |
#3
| |||
| |||
|
|
I have a window with a subform that has a subform. The main (outter) window is a single form that enables navigation through the recordset via buttons (btnFirst,btnPrevious,btnNext,btnLast). I would normally put an unbound combobox at the top to enable the user to "jump" to a particular record by selecting one of the rows in the combobox. However the window seems a bit full and I really don't want to change the design of that window. However, there is room for a command button that I thought could be used to open pop-up window with a combobox to be use to "find/jump" to a particular record in the original outter window (at the combobox.AfterUpdate event). However, I haven't figured out how to "tell" the calling window what to do. Since I intended to keep the outter window open and visible while the pop-up window is displayed I can't use the docmd.openform method to pass the recordID back to the calling form. |
#4
| |||
| |||
|
#5
| |||
| |||
|
#6
| |||
| |||
|
|
Well, I have it working. Perhaps a bit inelegant, but working. In case anybody out there is reading and wants to know how I did it and perhaps wants to make a critique ... 1. Initial form: frmEvents 2. Click on btn to open popup: btnFindEvent 3. frmFindEvent has the following functions: Option Compare Database Option Explicit Private Sub cboEvents_AfterUpdate() On Error GoTo Err_cboEvents_AfterUpdate lngJumpToRec = Me!cboEvents 'global variable DoCmd.Close Forms("frmEvents")!btnFirst.SetFocus 'change focus in Events display window Exit_cboEvents_AfterUpdate: Exit Sub Err_cboEvents_AfterUpdate: If Err.Number <> 2110 Then 'disregard this error Call ShowError("frmFindEvent", "cboEvents_AfterUpdate", Err.Number, Err.Description) End If Resume Exit_cboEvents_AfterUpdate End Sub Private Sub Form_Open(Cancel As Integer) 'Open form where I want it to open on the screen DoCmd.MoveSize 1440 * 2.95, 1440 * 8.25 End Sub 4. When btnFirst gets focus in the Events Display screen (frmEvents) it does the following to repoint the recordset to the desired record: Private Sub btnFirst_GotFocus() On Error GoTo Err_btnFirst_GotFocus Dim db As DAO.Database Dim rst As DAO.Recordset If lngJumpToRec > 0 Then 'Force all records to load Me.RecordsetClone.MoveLast 'Position current record to the record w/ the input record ID Set db = CurrentDb Set rst = Me.RecordsetClone rst.FindFirst "[eventID] = " & lngJumpToRec Me.Bookmark = rst.Bookmark rst.Close Set rst = Nothing Set db = Nothing lngJumpToRec = 0 'reset global variable End If Exit_btnFirst_GotFocus: Exit Sub Err_btnFirst_GotFocus: Call ShowError("frmEvents", "btnFirst_GotFocus", Err.Number, Err.Description) Resume Exit_btnFirst_GotFocus End Sub Regards, SueB *** Sent via Developersdex http://www.developersdex.com *** |
![]() |
| Thread Tools | |
| Display Modes | |
| |