goto record on form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a text box for searh criteria on a form and a button to bring up
records showing on another form. Every thing works great except, all the
other records lock out. (Default where no records match brings them all up
as well.) I've been trying to use a goto Cmd, but can't seem to get it to
work. Combo boxes are out as well, because there's over 900 records to
locate. Any ideas?
 
I don't understand what you mean by "all the other records lock out".
Lock out where? The search form? The actual form? There are two
different ways to do this:

METHOD 1) Search for a specific record and force the user to stay stuck
on that record. (This is usually DESIRABLE, forcing the user to go
back to the search form for a different record)
Form 1: DoCmd.OpenForm "Form2Name", , strFilter
Form 2: Me.Allowadditions = false

METHOD 2) Search for a specific set of records and bring the user to
the first matching record via OpeningArguments, allowing them to go
through all the records (This is usually undesirable because the
previous/next record may not match the filter):
Form 1: DoCmd.OpenForm "Form2Name", , ,,,,strFilter
Form 2: In the OnOpenEvent
If Nz(Me.OpenArgs,"")="" then
Docmd.Close acform, "Form2Name"
Else
DoCmd.FindRecord Me.OpenArgs
Endif
 
I got it working, thanks!

J said:
I don't understand what you mean by "all the other records lock out".
Lock out where? The search form? The actual form? There are two
different ways to do this:

METHOD 1) Search for a specific record and force the user to stay stuck
on that record. (This is usually DESIRABLE, forcing the user to go
back to the search form for a different record)
Form 1: DoCmd.OpenForm "Form2Name", , strFilter
Form 2: Me.Allowadditions = false

METHOD 2) Search for a specific set of records and bring the user to
the first matching record via OpeningArguments, allowing them to go
through all the records (This is usually undesirable because the
previous/next record may not match the filter):
Form 1: DoCmd.OpenForm "Form2Name", , ,,,,strFilter
Form 2: In the OnOpenEvent
If Nz(Me.OpenArgs,"")="" then
Docmd.Close acform, "Form2Name"
Else
DoCmd.FindRecord Me.OpenArgs
Endif
 
Back
Top