Selecting a record in a continuous form to edit

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

Guest

I have a continuous form that displays a list of filtered records. What i
now need to do is add an "edit" button, ideally at the edge of each record,
that would take the user into a single record form with the selected data.

I have attempted this, but whichever edit button i press, it seems to always
default the single form to exactly the same record. I know there must be a
way to do this, i simply cannot find it!!

My database has been designed using the macros and format functions as i do
not have much visual basic knowledge, so ideally any solution would need to
work via these methods.
 
Hi Rob-

When you design the single record form, made the default value for each
field the value of the selected record in the continuous form. Also,
consider just placing ONE edit button on your main form that opens up
the edit window. As example, the following would get a fieldname if
you put in your form and textbox control names as indicated:

=[Forms]![YourContinuousFormName]![YourTextboxControlName]

And, if your continuous form is actually a subform on a larger main
form, the following would work:

=[Forms]![YourMainFormName]![YourContinuousSubformName].[Form]![YourTextboxControlName]

hth-

Betsy
 
Well, for code, the folwling would work.

me.Refresh ' force a disk write

docmd.openform "frmEditDetails",,,"id = " & me!id

if you don't allow editing in the contihoues form..then you can remove the
me.Refresh, and it is only one line of code.

You could also use the macro...open form, but you would have to setup the
"where" expression of that macro..and I don't know how to do that....

The above is only one (or two) lines of code anyway ..
 
Back
Top