Select record in continuous form with button (in detail)

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

Guest

Klatuu,

I need your help again. I have a continuous form of records that I will
edit by clicking on a button that opens another form. The button is in the
detail. The form opening up should contain only the values from the record
line where the button was clicked. What code should I use to select the
correct record? I've been reading some about conditional formatting, but I'm
not sure how that works.

Thanks!!
 
Hi Elleve,

Well, I'm not Klatuu, but I can help you

1. you do not need to put yout button in the detail -- it
can go in the form header or footer where it will only be
displayed once

2. conditional formatting has nothing to do with this (that
I can see)

3. you can open the new form with a filter

DoCmd.OpenForm "FormName",,,"IDfield_newform = " &
me.ID_controlname_currentform

if you are not using numeric fields

DoCmd.OpenForm "FormName",,,"field_newform = '" &
me.controlname_currentform & "'"

Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access
strive4peace2006 at yahoo.com
 
Thanks for the reply Crystal. I like your suggestion, but I would like to
keep the button in the detail. The reason for this is that while the main
form is based on one query, the form opening is based on another query. The
two queries do have a total of five fields that are the same. The query to
open it up on the second form shows up exactly like the first form. However,
I would like to show only one record to be allowed to change. Is there a way
I can "link" the button to the correct record, use a loop or something in
that direction? I believe I was able to do this before but I cannot remember
how since it's been a while.
 
Hi Elleve,

read the instructions I gave you for

3. you can open the new form with a filter

If you have problems, please post back with more information
about your forms and the fields for linking and the
controlnames they are in.

Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access
strive4peace2006 at yahoo.com
 
Back
Top