If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Double Click Open Form to Record Number
Hello,
Please assist me with an Access procedure; I am working with Access 2003, Window XP Professional. I have a form name frmPending with a field name RecordNumber. I would like to double click on the field name RecordNumber and open a form name frmInventory to the record number specified on frmPending. -- Tim |
#2
|
|||
|
|||
Double Click Open Form to Record Number
On Tue, 7 Oct 2008 19:48:00 -0700, Tim wrote:
This is how I do that: I pass in the value via the OpenArgs argument to DoCmd.OpenForm, and then in the Form_Load of the second form position the recordset to that record. The code: DoCmd.OpenForm "frmInventory",,,,,Me.RecordNumber 'I hope that was enough commas to get to the OpenArgs argument Then in Form_Load of frmInventory: if Len(Me.OpenArgs)0 then with Me.RecordsetClone .FindFirst "RecordNumber=" & Me.OpenArgs if .NoMatch then Msgbox "Aaaarrrccchhhh!!!" else Me.Bookmark = .Bookmark end if end with end if If you don't care about the cool ability to scroll to other records, there is a much simpler solution, the one-liner: DoCmd.OpenForm "frmInventory",,,"RecordNumber=" & Me.RecordNumber -Tom. Microsoft Access MVP Hello, Please assist me with an Access procedure; I am working with Access 2003, Window XP Professional. I have a form name frmPending with a field name RecordNumber. I would like to double click on the field name RecordNumber and open a form name frmInventory to the record number specified on frmPending. |
Thread Tools | |
Display Modes | |
|
|