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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

a2k - filtering a form 1

Status
Not open for further replies.

Richard6699

Technical User
Jul 15, 2003
3
GB
This is so basic but I need a bit of help...

I have a main form containing employees.

If the user clicks a button to open a popup form, this should only contain related records.

So I need to open this popup using the id of the current employee. This will then hopefully filter the popup form's underlying table so I only see the related records.

My docmd.openform code is simply not working or gives an error.

Anyone have some code for what seems a straightforward problem?

thanks
 
Richard,

I do this a lot in the program I am working on now. I use openArgs to pass a value from my txtID field to the popup form.

DoCmd.OpenForm "frmPopup", OpenArgs:=Me.txtID.Value

Then in the popup forms onOpen I use

Me.txtID.Value = Me.OpenArgs

and then I set the Me.RecordSource = "Query using me.textID.value to filter"

There are probably easier ways to do this but this is the one I learned and it has always worked.

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top