Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form , Text box, Button

Status
Not open for further replies.

amal2004

Technical User
Jul 2, 2004
20
US
Hello

I am trying to create a form with a text box and a button. When you enter a value in the text box like ID Number and click the “Get” button, I need another form to pop up with the info related to that ID.. I really do appreciate any help.

 
Either use Global variable or well known cell.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Here's a little code snippet that puts a value in a global variable, then loads a form and inserts that value into the control. The Global statement needs to be at the top of a normal module (above any subs).
Code:
Global StatsRow

Sub DisplayStatsForm()
Dim StatsRow As Integer
Sheets("MarketHistory").Activate
StatsRow = ActiveCell.Row
Load MarketStatsForm
MarketStatsForm.StatsRowBox.Value = StatsRow
MarketStatsForm.GenStatsButton.SetFocus
MarketStatsForm.Show
End Sub
In your case you will want to insert a Find routine where I get ActiveCell.Row to grab whatever information you want from the appropriate row. Load each piece of information into a global variable and pass it to the new form. Alternately, you could just load the form, then put the code that retrieves the values in the new forms Initialize or Activate events (I think you could bypass using the global variables then).

VBAjedi [swords]
 
PHV :) I am working with access 2000. I need to know what criteria shell i put in the first form and what should be in the open event of the secound form (The pop Up form)....

Thanks
 
VBAjedi ..
Thanks for your reply... I am sorry if I did not mention that i am using access form the start.. Please can you guide me through making the forms and entering the code, i am a fast Lerner ..
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top