selecting a record from continuous form

D

Don Barton

Access 2007 Vista
I have an unbound search form (form A) with two parameter fields.
On this unbound search form is a sub-continuous form (form sub A) that
gets populated with results from the search parameters entered.
I want to take the search results and click on the desired record's
record selector object on the contiuous subform (form sub A) and have
that record populated into form B.
Another subform (form sub B) will be attached to this form B when i
get it working that I will add additional data too.
This seems like it would be straight forward, but I am having a hard
time getting the selected record to get populated on the other form.
On DoCmd.openform I've tried a filter, criteria, and OpenArg. I don't
think the record selector selected is getting recognized.


Don
LabDBDesigns
 
A

Access Developer

I've never had a case when DoCmd.OpenForm with a filter or criteria failed
unless I made a mistake in coding it... read the specs and check your code
carefully -- as a last resort, put a stop on the DoCmd.OpenForm, and
manually check to make sure the values are what you expect.

I have sometimes used the OpenArgs to pass information, and then changed the
RecordSource in the OpenEvent of the Form being opened and have also had
good luck with DoCmd.OpenReport.

Larry Linson
Microsoft Office Access MVP
 
D

Don Barton

I've never had a case when DoCmd.OpenForm with a filter or criteria failed
unless I made a mistake in coding it...
I have sometimes used the OpenArgs to pass information, and then changed the
RecordSource in the OpenEvent of the Form being opened and have also had
good luck with DoCmd.OpenReport.

 Larry Linson
 Microsoft Office Access MVP


Thanks Larry,
I was able to solve it once I went to a "cmdbutton on every record" as
suggested by other posts. My original cmdbutton was on the parent
form. That being said, I now have both buttons working, and it was an
issue of coding as you suggested, but I could have sworn I tried it
before. Oh well.
From what I could tell, the "where" criteria in the openform event
does not like "Me.controlname, so using the full form path did work.
"RGMedicalNumber=Forms!frmSelectPatient!frmSelectPatient2!
RGMedicalNumber"

Thanks again,

Don
LabDBDesigns
 
A

Access Developer

Yes, using / accessing Controls in an Open event is "iffy"... they may or
may not be fully initiated when you access them. If you want to access
Controls on a Form before doing other things, use the Load event, instead.

Larry Linson
Microsoft Office Access MVP

I've never had a case when DoCmd.OpenForm with a filter or criteria failed
unless I made a mistake in coding it...
I have sometimes used the OpenArgs to pass information, and then changed
the
RecordSource in the OpenEvent of the Form being opened and have also had
good luck with DoCmd.OpenReport.

Larry Linson
Microsoft Office Access MVP


Thanks Larry,
I was able to solve it once I went to a "cmdbutton on every record" as
suggested by other posts. My original cmdbutton was on the parent
form. That being said, I now have both buttons working, and it was an
issue of coding as you suggested, but I could have sworn I tried it
before. Oh well.
From what I could tell, the "where" criteria in the openform event
does not like "Me.controlname, so using the full form path did work.
"RGMedicalNumber=Forms!frmSelectPatient!frmSelectPatient2!
RGMedicalNumber"

Thanks again,

Don
LabDBDesigns
 

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