One form to another

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form which lists all the records in a table. What I would like to do
is to be able to select 1 record or double click it or something which would
then open up another form just with that one record for edit.

Is this possible? and how?
 
The easiest method I know of is to add a command button in the detail
section of the continuous form that opens your new form based on the value
in the continuous form. Then find the double-click event of a control on
your main form and view its Event Procedure. Copy the code from the command
button into the On Double-Click event.

Once this is successful, you can delete the command button and the code for
the command button.
 
What would the code be to open the form based on the value. Can you give me
an example?
 
Dim strWhere as String
Dim strFormName as String
strWhere = "[IdField]=" & Me.txtIdField
strFormName ="frmDetailRecord"
DoCmd.OpenForm strFormName, acNormal, , strWhere

If your IDField is text, you would need to use:
strWhere = "[IdField]=""" & Me.txtIdField & """"
 

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

Back
Top