Full Version: Scrollable Form to Select Another Form To Open
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
gtadamsesq
I designed a OwnerLookup form using the form design wizard; selected “Tabular” view; and using the Toolbox / Command button option, installed a button to “Open A Form” when clicked. The OwnerLookup form scrolls nicely through available records, but clicking the “Open Form” button always opens the first record only, not the record scrolled to. I also designed a similar form using “Columnar” view, and the installed “Open A Form” button opens the form at the selected record. I don’t understand why the form designed in “Tabular” view won’t do the same thing. What have I done wrong?
vtd
You probably didn't set any "wherecondition" argument in the OpenForm statement.

Check Access VB on the OpenForm Method and its argument. You need to specify the "wherecondition" argument using a value that uniquely identifies the CurrentRecord on the OwnerLookUp Form.
gtadamsesq
Thanks!

Once I got the

Dim stLinkCriteria As String

and

stDocName = "Update Record Owner"
stLinkCriteria = "[pLastName] = '" & [PLASTNAME] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

entered in the onclick, it worked like a charm.

George
vtd
You're welcome. Glad you worked it out easily.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.