Easy one...

  • Thread starter Thread starter sameat
  • Start date Start date
S

sameat

Please excuse my complete lack of knowledge.

I want my fom to ask me for which record to display when I open it.

How do I do that?
 
Please excuse my complete lack of knowledge.

I want my fom to ask me for which record to display when I open it.

How do I do that?

A nice way to handle this is to add an unbound TextBox or ComboBox to the form
labelled "Go To...". Then you initially open the form displaying no record...

DoCmd.OpenForm "FormName",,,"False"
("False" is just shorthand for a filter that is never satisfied).

Then you use the AfterUpdate event of the unbound control to apply a filter that
is satisfied by exactly one record.

(if primary key field is numeric)
Me.Filter = "PrimaryKeyField = " & Me.GoToControlName
Me.FilterOn = True

(if primary key field is text)
Me.Filter = "PrimaryKeyField = '" & Me.GoToControlName & "'"
Me.FilterOn = True
 

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

Back
Top