Call a form from a subform

S

Sequel

I got a father form named "frmsearch", it's also contains a subform
"sfsearch" which would open a form name "frmnotice". If I click on any
register inside a subform, it should open the "frmnotice" with the data
selected. In order to show the data to the user. Any help will be
welcome...Thx a lot.
 
A

Allen Browne

To open frmNotice to a particular record, use OpenForm with a
WhereCondition.

Use whatever event suits you, e.g. the Click of a command button, or the
DblClick of a control.

Example event procedure, assuming a numeric field named ID:
Dim strWhere As String
If Not IsNull(Me.[ID]) Then
strWhere = "[ID] = " & Me.[ID]
DoCmd.OpenForm "frmPreview", WhereCondition:= strWhere
End If

If ID is a text field (not a number field), you need extra quotes. Here's
how:
http://allenbrowne.com/casu-17.html
 

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