OpenForm to a selected record from ajbFindAsYouType

G

Guest

I am using ajbFindAsYouType with a tabular table and it works great!
Thanks Allen!

I have built a table with only the fields I want to search/filter on.
I'd like to use it as "menu."
So I added a button (though a double click would work just as well) to the
body of the form such that there is a button for each record displayed. This
button calls a "data entry" form with all of the fields for a record.

The code attached to the button uses OpenForm such that

stDocName = "user_ProjectData"
stLinkCriteria = "[ID]=" & Me![ID]

opens the form to the right record! But only that record.

I would like for all of the records to be available to the user in case they
don't want to have to go back to the menu to select another record (say the
next one in sequence).

I wonder if I can pass stLinkCriteria to the OnOpen event of the called form?

Thanks,

owp^3
 
G

Guest

You could use OpenArgs.
DoCmd.OpenForm "myForm",,,,,Me![ID]

Then, in the OnLoad or OnOpent event of your form:
Dim rs As Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "[ID] = " & Me.OpenArgs
If Not rs.EOF Then Me.Bookmark = rs.Bookmark

Steve
 
G

Guest

That makes sense.
But I get a syntax error
"(missing operator) in expression" at the
rs.FindFirst line

should I have changed something in that line or cut/paste as you typed it?

Thanks,

SteveM said:
You could use OpenArgs.
DoCmd.OpenForm "myForm",,,,,Me![ID]

Then, in the OnLoad or OnOpent event of your form:
Dim rs As Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "[ID] = " & Me.OpenArgs
If Not rs.EOF Then Me.Bookmark = rs.Bookmark

Steve
owp^3 said:
I am using ajbFindAsYouType with a tabular table and it works great!
Thanks Allen!

I have built a table with only the fields I want to search/filter on.
I'd like to use it as "menu."
So I added a button (though a double click would work just as well) to the
body of the form such that there is a button for each record displayed. This
button calls a "data entry" form with all of the fields for a record.

The code attached to the button uses OpenForm such that

stDocName = "user_ProjectData"
stLinkCriteria = "[ID]=" & Me![ID]

opens the form to the right record! But only that record.

I would like for all of the records to be available to the user in case they
don't want to have to go back to the menu to select another record (say the
next one in sequence).

I wonder if I can pass stLinkCriteria to the OnOpen event of the called form?

Thanks,

owp^3
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top