Search Form

rbarlow

New member
Local time
Today, 14:02
Joined
Mar 13, 2006
Messages
6
I'm making a form for searching which opened from a main form, displays results in a listbox and repositions the record of the main form accordingly.

I have the listbox displaying all the results and everything, but I've run into a problem repositioning the main forms record. The results consist of an ID which is the primary key of the main forms datasource.

Is there a way to return a value from a form?

I'm opening the form with the docmd.openform method.
 
try something like this:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "the main form"

stLinkCriteria = "[ID Number]=" & Me![lstItem].Column(1)
DoCmd.OpenForm stDocName, , , stLinkCriteria

I use it on the onclick event for the listbox
 
Yup I tried this before but instead of moving to the specific record... it creates a filter on the primary field. I dont' want to fool around with any filters or anything, just moving the record position (on the main form I did this with Me.Bookmark).
 

Users who are viewing this thread

Back
Top Bottom