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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making 2 separate queries use the same prompt

Status
Not open for further replies.

zigman02

IS-IT--Management
Nov 28, 2005
2
US
I have a report within Access that draws off 2 separate queries. The queries have the exact same prompt and the result you type in is the same for both. Is there a way to only be prompted once and have both queries recognize it?

This is the code:

Private Sub Command7_Click()
On Error GoTo Err_Command7_Click

Dim stDocName As String

stDocName = "List Search"
DoCmd.OpenReport stDocName, acPreview

stDocName = "List Search 2"
DoCmd.OpenReport stDocName, acPreview

Exit_Command7_Click:
Exit Sub



Err_Command7_Click:
MsgBox Err.Description
Resume Exit_Command7_Click

End Sub

Both "List Search" and "List Search 2" have a prompt that says "enter search criteria
 
You could use a form, then each query would have criteria like this:
Forms![Form Name]![TextBoxName]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top