Retrieving Existing Records on a Form

  • Thread starter chris1 via AccessMonster.com
  • Start date
C

chris1 via AccessMonster.com

I have a form that is based on a table of information. I would like ther user
to type in the primary key value and have the other related information
appear on the form without using the record selectors.

I could create a small form that requests the primary value and have them
click a button to have the infomation appear but is there another and simpler
way? Please help!
 
C

cho

Cheese,
I have a date column in my tabel ( only one column ),
and I want to create filter that will retrieve the record
based to the date I entered in my filter text box with
criteria "between ( date ) and ( date )".
And another option use combo box just like u said in
your previous post.
Would u like to help.
 
D

Douglas J. Steele

You should never work directly with tables. You should always use forms for
input, and reports for output.
 
R

Ruel Cespedes via AccessMonster.com

I can help you. In design view of the form in quesiton make sure you have
the Header/Footer viewable. You will place the primary key search field in
the Header area of the form.

I'm going to assume a few things like the Name of the Table and the Name of
the Primary Key Field. Lets say your table is called "Projects". Lets also
say your primary key field is called "ProjectID".

Next you will create a unbound textbox called "SearchPrimaryKey" and create
an AfterUpdate Procedure that looks like this:

Private Sub SearchPrimaryKey_AfterUpdate()
Me.Filter = "((Projects.ProjectID=" & Me.SearchPrimaryKey & "))"
Me.FilterOn = True
End Sub




Ruel
 
C

chris1 via AccessMonster.com

Hi Ruel,

Thank you for your response. It worked. I also used a DoCmd.ApplyFilter on a
commandbox for an unbound textbox as you had mentioned below. Thank you!
 
R

Ruel Cespedes via AccessMonster.com

Glad to hear it worked! Much luck and success to you!

Ruel
 

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