Using Wizard to open form and go to record

N

NickW

I would like to create a sort of switch that has "search" boxes (unbound text
fields). In 2003, one could create a form with unbound text fields and use
the Command Button Wizard to open a form and go to a specific record. I get
to that point in 2007, but then it gets weird. The wizard asks to match up
fields on the current form and the one you want to open. But, on the current
form side, there are no text fields to match it up with. Is there a fix for
this?
 
D

Damon Heron

You will have to go to the VB Code and add the stLinkCriteria manually:
Dim stDocName As String
Dim stLinkCriteria As String

stLinkCriteria = "YourRecordID = " & Me.Textbox1
stDocName = "YourFormName"
DoCmd.OpenForm stDocName, , , stLinkCriteria

where textbox1 contains the ID of the record you want to go to when opening
the new form. If you want to use a string field, then
you will have to modify the code slightly -- "YourRecordString = " & "'" &
me.Textbox1 & "'".

Damon
 

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