By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,290 Members | 1,195 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,290 IT Pros & Developers. It's quick & easy.

ListBox Value One form to another without filter applied

P: n/a
Hi All

Access 2007

I have a form with a ListBox called "ListContactTasks"
DoubleClicking the ListBox opens another form called "frmContact" at a
particular record corresponding to the one in the listbox Column(0)

The ListBox is on a form that has no recordset of it's own.

Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmContact"
stLinkCriteria = "[ContactID]=" & Me![ListContactTasks].Column(0)
DoCmd.OpenForm stDocName, , , stLinkCriteria

My problem is that it takes me to the correct record alright, but
applies a filter that endusers compalin about.

So my question: Is there a technique to achieve the above WITHOUT the
filter remaining on?

Regards and Thanks

Apr 11 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Apr 11, 10:23 am, "bobdydd" <reallyuseful2...@yahoo.co.ukwrote:
Hi All

Access 2007

I have a form with a ListBox called "ListContactTasks"
DoubleClicking the ListBox opens another form called "frmContact" at a
particular record corresponding to the one in the listbox Column(0)

The ListBox is on a form that has no recordset of it's own.

Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmContact"
stLinkCriteria = "[ContactID]=" & Me![ListContactTasks].Column(0)
DoCmd.OpenForm stDocName, , , stLinkCriteria

My problem is that it takes me to the correct record alright, but
applies a filter that endusers compalin about.

So my question: Is there a technique to achieve the above WITHOUT the
filter remaining on?

Regards and Thanks

If you can make a few changes to the forms, my prefered method would
be to supply the criteria in the OpenArgs and move the forms book mark
when it opens.

<In Click Event change last line to >
DoCmd.OpenForm stDocName, , , , , , stLinkCriteria

<In other forms open event, add or insert >
Dim rst As DAO.Recordset

'Change to continue event if other code runs
If IsNull(Me.OpenArgs) Then Exit Sub
Set rst = Me.RecordsetClone
rst.FindFirst Me.OpenArgs
If Not rst.NoMatch Then Me.Bookmark = rst.Bookmark

Set rst = Nothing

The form should move to the selected record if found, open to the
begining if not, no filter applied.

Apr 12 '07 #2

P: n/a
Thanks!

I will give that try

Apr 12 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.