display data

D

Dan @BCBS

I'm sure this is a simple question but I cannot find the answer.

I enter a value in a text box then I click a command button to open a form.
When the form opens it needs to display the number I just entered in the
text box.

Do I add some kind of refresh to the on click???
 
B

Beetle

You need some criteria in the On_Click event of your command button. It
should look something like the following (substitute your own form and
control names);

Dim strDocName As String
Dim strLinkCriteria As String

strDocName = "NameOfYourForm"
strLinkCriteria = "[SomeControlName] =" & Me![SomeOtherControlName]
(if the above referenced controls are text, then you'll need to add some
additional quotes like below)

strLinkCriteria = "[SomeControlName] = '" & Me![SomeOtherControlName] &
"'"


DoCmd.OpenForm strDocName, , , strLinkCriteria


HTH
 

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