A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Double Click Open Form to Record Number



 
 
Thread Tools Display Modes
  #1  
Old October 8th, 2008, 03:48 AM posted to microsoft.public.access.forms
Tim
external usenet poster
 
Posts: 19
Default 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  
Old October 8th, 2008, 04:19 AM posted to microsoft.public.access.forms
Tom van Stiphout[_2_]
external usenet poster
 
Posts: 1,653
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:32 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.