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

displaying a find result on a form

Status
Not open for further replies.

barny2006

MIS
Mar 30, 2006
521
US
hi folks,
i have an access application with a form (form1) displaying name, address, other info. a user has asked for a command button to find a unique record and place it on the form thats open and displaying other name. what should i have for the command button to display the retrieved data, formatted to the form on the screen? i put a macro under the button to execute a select query. but the result of the query is displaying on tabular format instead of on the form1. any suggestions?
thanks.
 
Your not very clear in your description, but you could have UNBOUND textboxes on your form and then use the DLookup function to find the appropriate info from another table. Such as:

Private Sub Command1_OnClick()

Me![zone1] = DLookup("[ZoningCode]", "TableName", "[MMCNumber] = " & Chr(34) & Forms![YourFormName]![MMCNumber] & Chr(34))

Me![prop] = DLookup("[PropertyID]", "TableName", "[MMCNumber] = " & Forms![YourFormName]![MMCNumber]

End Sub

The first example shows how to search for an alpha, the second example shows for a numeric.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top