Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Form at Specific Place

Status
Not open for further replies.

SDS100UK

MIS
Jul 15, 2001
185
GB
Hi,

Access Xp

I have searched the FAQ's and the forums but cant quite find exactly what i am looking for.

I have a form open with a customer Ref number.
I want a second form to open at the same customer (which I can do fairly easily)

The code I have currently opens the second form with only that record in the dynaset and what i really need is to have all te records there, but just open at the specific one i requested.

Here is my (simple) code:

DoCmd.OpenForm "Customer Details", , , "[CustomerReference]=" & Me![CustomerReference]

Thanks in advance.

Steven

 
Hi

Change you docmd.openform to put the CustomerId in the Openargs parameter (the last parametr in the possible list)

In the Openned form "Customer Details", in the onopen event examine teh .openargs property, if it is not null do

Me.REcordsetClone.findfirst "[Customer Reference] = " & me.Openargs
If ME.REcordsetClone.NoMatch Then
Else
Me.Bookmark = me.recordsetclone.bookmark
end if

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Thanks for that Ken,

I am a little slow I am afraid....what do i change the open args parameter to?

I have never used this before and so am unsure on the syntax.

Many thanks again though


Steven
 
Hi

You do not have to do anything except put in few commas like so:

DoCmd.OpenForm "Customer Details", , , ,,Me![CustomerReference]

Se help for exact syntax



Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top